zoukankan
html css js c++ java
常用函数
//
同时修改主从表、或多表的时候,对从表的更新模式做调整
protected
override
void
SetUpdateMode(SQLTableInfo info,
ref
UpdateMode mode)
{
if
(info.TableName
==
fFaultTableInfo.TableName
||
info.TableName
==
fProductTableInfo.TableName)
mode
=
UpdateMode.Merge;
}
//
代码表
protected
override
void
AddCodeTable(StringCollection codeTables)
{
base
.AddCodeTable(codeTables);
codeTables.Add(
"
CD_SELL_AREA
"
);
//
销售范围
}
//
数据权限
protected
override
void
SetSubFunctionKey(PageStyle style,
ref
object
subKey)
{
base
.SetSubFunctionKey (style,
ref
subKey);
}
//
主从表内容
protected
override
void
AddDetailListTable(StringCollection detailTables, StringCollection detailCodeTables,
object
key)
{
//
登录的用户信息
string
UsersSql
=
string
.Format(
"
SELECT DISTINCT USER_ID CODE_VALUE,USER_NAME CODE_NAME FROM UR_USERS
WHERE (USER_ID IN(SELECT HP_CREATE_ID FROM EB_HOSPITAL WHERE HP_ID
=
'
{0}
'
)) OR (USER_ID IN(SELECT HP_UPDATE_ID FROM
EB_HOSPITAL WHERE HP_ID
=
'
{0}
'
))
"
,key.ToString());
BrowseInfo.ChangeSql(UsersSql,
"
UR_USERS
"
,DbConnection,
this
);
//
医院信息
string
HospitalSql
=
string
.Format(
"
select * from EB_HOSPITAL EB_HOSPITAL_DETAIL where HP_PARENT_ID =
'
{0}
'"
,key.ToString());
BrowseInfo.ChangeSql(HospitalSql,
"
EB_HOSPITAL_DETAIL
"
,DbConnection,
this
);
//
人员信息
string
PersonSql
=
string
.Format(
"
select EB_PERSON_INFO.* from EB_PERSON_INFO INNER JOIN EB_HOSPITAL
ON PI_HP_ID
=
HP_ID AND HP_ID
=
'
{0}
'"
,key.ToString());
BrowseInfo.ChangeSql(PersonSql,
"
EB_PERSON_INFO
"
,DbConnection,
this
);
//
保修卡信息
string
CardSql
=
string
.Format(
"
SELECT EB_GUARANTEE_CARD.*, EB_PRODUCT_OUT.* FROM EB_HOSPITAL INNER
JOIN EB_GUARANTEE_CARD ON EB_HOSPITAL.HP_ID
=
EB_GUARANTEE_CARD.GC_HP_ID AND EB_HOSPITAL.HP_ID
=
'
{0}
'
INNER JOIN
EB_PRODUCT_OUT ON EB_GUARANTEE_CARD.GC_PC_CODE
=
EB_PRODUCT_OUT.PO_PC_CODE AND EB_GUARANTEE_CARD.GC_BAR_CODE
=
EB_PRODUCT_OUT.PO_BAR_CODE
"
,key.ToString());
BrowseInfo.ChangeSql(CardSql,
"
EB_GUARANTEE_CARD
"
,DbConnection,
this
);
base
.AddDetailListTable(detailTables, detailCodeTables, key);
}
//
多表的修改
protected
override
void
FillUpdateTables(
object
key,PageStyle style)
{
TableInfo.SetKeyValueAndFill(DbConnection,key,
this
);
fCFTableInfo.FillData(
this
,DbConnection,
string
.Format(
"
WHERE CF_RSC_ID = {0}
"
,key.ToString()));
fCSFTableInfo.FillData(
this
.DbConnection,
string
.Format(
"
WHERE CSF_RSC_ID = {0}
"
,key.ToString()));
//
工作报告信息
string
ReportSql
=
string
.Format(
"
select SR_ID AS CODE_VALUE,SR_CODE AS CODE_NAME from EB_SERVICE
where SR_ID
=
'
{0}
'"
,Tables[TableName].Rows[0][
"
RSC_SR_ID
"
].ToString());
BrowseInfo.ChangeSql(ReportSql,
"
EB_SERVICE
"
,DbConnection,
this
);
MidSearchFields.FillDataSet(
this
);
}
//
夺标的修改删除
protected
override
void
FillUpdateTables(DataSet postDataSet)
{
//
从表内容
string
key
=
postDataSet.Tables[TableName].Rows[
0
][KeyFields].ToString();
TableInfo.SetKeyValueAndFill(DbConnection,key,
this
);
fCFTableInfo.FillData(DbConnection,
string
.Format(
"
WHERE CF_RSC_ID = '{0}'
"
,key));
fCSFTableInfo.FillData(DbConnection,
string
.Format(
"
WHERE CSF_RSC_ID = '{0}'
"
,key));
//
将服务工作报考的名称替换为ID PostDataSet.Tables
DataTable fTable
=
PostDataSet.Tables[TableName];
string
sql
=
string
.Format(
"
Select SR_ID from EB_SERVICE where
SR_CODE
=
'
{0}
'"
,fTable.Rows[0][
"
RSC_SR_ID
"
]);
string
fsr_id
=
DataSetUtil.ExecuteScalar(sql,DbConnection).ToString();
//
替换结束
if
(fsr_id
==
null
||
fsr_id
==
string
.Empty)
{
ErrorObjects.Add(
new
ErrorObject(
"
EB_REPAIR_SERVICE_CONTRACT
"
,
"
RSC_SR_ID
"
,
"
输入服务单号不
正确
"
,0));
fTable.Rows[
0
][
"
RSC_SR_ID
"
]
=
DBNull.Value;
}
else
{
fTable.Rows[
0
][
"
RSC_SR_ID
"
]
=
Convert.ToInt32(fsr_id);
}
CheckPostData(PostDataSet,fCFTableInfo);
CheckPostData(PostDataSet,fCSFTableInfo);
}
public
void
CheckPostData(DataSet postData,SQLTableInfo fDtailTableInfo)
{
DataTable table
=
postData.Tables[fDtailTableInfo.TableName] ;
if
(table
==
null
)
{
TableInfoCollection.Remove(fDtailTableInfo);
return
;
}
if
(postData.Tables.Contains(fDtailTableInfo.TableName))
{
int
i
=
1
;
for
(
int
j
=
table.Rows.Count
-
1
; j
>=
0
;
--
j,
++
i)
{
DataRow row
=
table.Rows[j] ;
if
(row[fDtailTableInfo.KeyFields].ToString()
==
string
.Empty)
row[fDtailTableInfo.KeyFields]
=
-
i ;
}
}
}
protected
override
void
CommittingData()
{
base
.CommittingData ();
if
(
this
.CurrentPageStyle
==
PageStyle.Update
&&
this
.PostDataSet.Tables[fCFTableInfo.TableName]
==
null
&&
Tables[fCFTableInfo.TableName]
!=
null
&&
Tables[fCFTableInfo.TableName].Rows.Count
>
0
)
{
fCFTableInfo.SetCommands(AdapterCommand.Delete,DbConnection);
foreach
(DataRow row
in
Tables[fCFTableInfo.TableName].Rows)
{
row.Delete();
}
TableInfoCollection.Add(fCFTableInfo);
}
if
(
this
.CurrentPageStyle
==
PageStyle.Update
&&
this
.PostDataSet.Tables[fCSFTableInfo.TableName]
==
null
&&
Tables[fCSFTableInfo.TableName]
!=
null
&&
Tables[fCSFTableInfo.TableName].Rows.Count
>
0
)
{
fCSFTableInfo.SetCommands(AdapterCommand.Delete,DbConnection);
foreach
(DataRow row
in
Tables[fCSFTableInfo.TableName].Rows)
{
row.Delete();
}
TableInfoCollection.Add(fCSFTableInfo);
}
}
查看全文
相关阅读:
Windows2003 Webshell默认权限
Windows安装Centos7双系统后Windows启动项消失
GCC编译流程及常用编辑命令
swoole的websockte例子
PhpStorm 增加Swoole智能提示
Centos7/RHEL 7 配置静态路由
webpack介绍和使用
Webpack中的sourcemap以及如何在生产和开发环境中合理的设置
什么是 PWA
php实现excel单元格合并,字体加粗居中等操作
原文地址:https://www.cnblogs.com/chinatefl/p/166077.html
最新文章
赶集网mysql开发36军规
[置顶] 一个Web报表项目的性能分析和优化实践(一):小试牛刀,统一显示SQL语句执行时间
SASS详解之编译输出的样式
使用ssh向sqlserver2005数据库中保存image类型的二进制图片
(高精度运算4.7.24)UVA 10013 Super long sums(大数加法——某一位的数字可能大于10)
[置顶] JDK工具(零)--简要介绍JDK1.6自带的42个工具
DriverStudio 和 WDF驱动 通过GUID获取设备句柄的差别
[置顶] SNMP协议详解<三>
c++ 读写Excel及数据导入SQLServer
Reverse Integer--整数的反转
热门文章
采用web service传输超大数据
SSL/TLS协议运行机制的概述
IIS6.0文件解析漏洞小结
编写自己的Acunetix WVS漏洞扫描脚本详细教程
SqlMap用户手册
Sqlmap Tamper大全
sqlmap的篡改绕过WAF
nmap常用扫描命令
Linux下暴力破解工具Hydra详解
挑战黑客极限:Pwn2Own 2015成史上“最难”黑客大赛
Copyright © 2011-2022 走看看