以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]复制 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=194685) |
||||
-- 作者:苏州老街 -- 发布时间:2025/1/5 12:28:00 -- [求助]复制 老师,下面代码怎样改成像图片上的复制状态 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 |
||||
-- 作者:y2287958 -- 发布时间:2025/1/5 14:20:00 -- 用filler |
||||
-- 作者:苏州老街 -- 发布时间:2025/1/5 20:34:00 -- 老师,搞不懂啊,谢谢老师。 |
||||
-- 作者:有点蓝 -- 发布时间:2025/1/5 20:39:00 -- 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/1/6 10:41:00 -- 谢谢老师,还有个问题汇总表的名称_楼号怎样自动填入。 |
||||
-- 作者:有点蓝 -- 发布时间:2025/1/6 11:01:00 --
|
||||
-- 作者:苏州老街 -- 发布时间:2025/1/6 20:14:00 -- 老师,点击审核列表自动关闭。 \'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编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2025/1/6 21:29:00 -- 刚添加完就删除,这是要闹哪出? |
||||
-- 作者:苏州老街 -- 发布时间:2025/1/6 22:00:00 -- 老师,哪里错了。 |
||||
-- 作者:有点蓝 -- 发布时间:2025/1/6 22:54:00 -- \' End If \' Next \' Else \' DataTables("汇总").deletefor("编号 = \'" & e.DataRow("编号") & "\'") \' End If
|