以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 跨表,代码执行了,数据没过去 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=130819) |
-- 作者:cd_tdh -- 发布时间:2019/2/2 15:49:00 -- 跨表,代码执行了,数据没过去 If e.DataCol.Name = "审批状态"
If e.DataRow("审批状态") = "已审批完成" Then Dim nma() As String = { "合同编码","项目编码","所属机构","项目类别","招标方式","项目名称","建设单位","合同金额","合同工期","项目经理","项目总工" } \'合同签订数据来源列 Dim nmb() As String = { "合同编码","项目编码","所属机构","项目类别","招标方式","项目名称","建设单位","合同金额","合同工期","项目经理","项目总工" } \'业绩管理数据接收列 e.DataRow.save Dim dr As DataRow = DataTables("合同归档").sqlFind("项目编码 = \'" & e.DataRow("项目编码") & "\'") \'找出合同编码相同的项目 If dr IsNot Nothing Then \'如果找到的话 dr("合同编码") = e.DataRow("合同编码") DataTables("合同归档") .save Else Dim dw As DataRow = DataTables("合同归档") .AddNew For i As Integer = 0 To nma.Length - 1 dw(nmb(i)) = e.DataRow(nma(i)) Next DataTables("合同归档") .save End If Else \'DataTables("合同归档").SQLdeletefor("合同编码 = \'" & e.DataRow("合同编码") & "\'") \'DataTables("合同归档").Save End If End If |
-- 作者:有点蓝 -- 发布时间:2019/2/2 16:01:00 -- If dr IsNot Nothing Then \'如果找到的话 dr("合同编码") = e.DataRow("合同编码") dr .save ‘sqlFind出来的行是独立的,要单独保存 |