老师,下面代码怎样改成像图片上的复制状态
If e.DataCol.Name = "审核"
If e.DataRow("审核") = True Then
Dim nma() As String = {"编号","抄表日期","项目","项目ID"} 'A表数据来源列
Dim nmb() As String = {"编号","抄表日期","项目","项目ID"} 'B表数据接收列
e.DataRow.save
Dim dr2 As DataRow = DataTables("汇总").Find("编号 = '" & e.DataRow("编号") & "'") '找到指定返回的行
If dr2 Is Nothing Then
Dim dr3 As DataRow = DataTables("汇总").AddNew
For i As Integer = 0 To nma.Length - 1
dr3(nmb(i)) = e.DataRow(nma(i))
Next
' dr("来源") = "销售" '入库表就改为"采购",其他表改为"其它"
End If
Else
DataTables("汇总").deletefor("编号 = '" & e.DataRow("编号") & "'") '退勾删除出租房数据汇总行
'DataTables("汇总").deletefor("_Identify = '" & e.DataRow("_Identify") & "'") '退勾不删除出租房数据汇总行
End If
End If
此主题相关图片如下:复制1.jpg
If e.DataCol.Name = "审核"
If e.DataRow("审核") = True Then
Dim nma() As String = {"编号","抄表日期","项目","项目ID"} 'A表数据来源列
Dim nmb() As String = {"编号","抄表日期","项目","项目ID"} 'B表数据接收列
Dim aaa() As String = {"一号楼","二号楼","三号楼"}
e.DataRow.save
for each a as string in aaa
Dim dr2 As DataRow = DataTables("汇总").Find("编号 = '" & e.DataRow("编号") & "' and 楼号='" & a & "'") '找到指定返回的行
If dr2 Is Nothing Then
Dim dr3 As DataRow = DataTables("汇总").AddNew
For i As Integer = 0 To nma.Length - 1
dr3(nmb(i)) = e.DataRow(nma(i))
Next
dr3("ID") = e.DataRow(a & "_ID") dr3("上期") = e.DataRow(a & "_上期")
……其它列自己补充完整
' dr("来源") = "销售" '入库表就改为"采购",其他表改为"其它"
End If
next
Else
谢谢老师,还有个问题汇总表的名称_楼号怎样自动填入。
此主题相关图片如下:2025-01-06 10 37 50.png
老师,点击审核列表自动关闭。
'If e.DataCol.Name = "审核"
'If e.DataRow("审核") = True Then
' Dim nma() As String = {"编号","抄表日期","项目","项目ID","抄表日期","年","月份","总表_上期读数","总表_本期读数","总表_消耗数","总表_消耗金额","分表_总耗量","分表_总耗金额"} 'A表数据来源列
'Dim nmb() As String = {"编号","抄表日期","项目","项目ID","抄表日期","年","月","总表_上期读数","总表_本期读数","总表_数量","总表_金额","分表_数量","分表_金额"} 'B表数据接收列
'Dim aaa() As String = {"一号楼","二号楼","三号楼"}
'e.DataRow.save
'For Each a As String In aaa
'Dim dr2 As DataRow = DataTables("汇总").Find("编号 = '" & e.DataRow("编号") & "' and 名称_号楼='" & a & "'") '找到指定返回的行
'If dr2 Is Nothing Then
'Dim dr3 As DataRow = DataTables("汇总").AddNew
' For i As Integer = 0 To nma.Length - 1
' dr3(nmb(i)) = e.DataRow(nma(i))
' Next
' dr3("名称_ID") = e.DataRow(a & "_ID")
' dr3("名称_楼号") = a
' dr3("上期读数") = e.DataRow(a & "_分表上期")
' dr3("本期读数") = e.DataRow(a & "_分表本期")
' dr3("使用数量") = e.DataRow(a & "_消耗数")
' dr3("金额") = e.DataRow(a & "_分表金额")
' dr3("总表金额") = e.DataRow(a & "_总表金额")
' dr3("累计缴费") = e.DataRow(a & "_累计缴费")
'……其它列自己补充完整
''' dr("来源") = "销售" '入库表就改为"采购",其他表改为"其它"
' DataTables("汇总").deletefor("编号 = '" & e.DataRow("编号") & "'")
' End If
' Next
' Else
' End If
[此贴子已经被作者于2025/1/6 20:19:02编辑过]
' End If
' Next
' Else
' DataTables("汇总").deletefor("编号 = '" & e.DataRow("编号") & "'")
' End If