Foxtable(狐表)用户栏目专家坐堂 → 命令顺序执行,禁止同时执行


  共有1453人关注过本帖树形打印复制链接

主题:命令顺序执行,禁止同时执行

帅哥哟,离线,有人找我吗?
liuandwang
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:94 积分:1039 威望:0 精华:0 注册:2018/4/28 23:27:00
命令顺序执行,禁止同时执行  发帖心情 Post By:2024/4/18 16:15:00 [只看该作者]

按键命令:目的是备份主表和明细表,并在备份完成后删除主表和明细表
主表和明细表通过“订单编号”关联,在执行命令时,提示所在行已删除无法复制,
或者备份的主表内容与原表不一致,如面积列,通过公式汇总明细表

应该是复制命令执行完全后,再执行删除命令,怎么做,拜托!!!

Dim Cols1() As String = {"订单编号", "接单日期", "产品名称", "面积".......}
Dim Cols2() As String = {"订单编号", "接单日期", "产品名称", "面积".......}
For Each dr1 As DataRow In DataTables("订单主表").Select("[核销] ='√'")
    Dim dr2 As DataRow = DataTables("主表归档").AddNew()
    For i As Integer = 0 To Cols1.Length - 1
        dr2(Cols2(i)) = dr1(Cols1(i)) 
    Next 
    dr1.Delete
Next

Dim Cols3() As String = {"订单编号", "接单日期", "产品名称", "产品颜色".......}
Dim Cols4() As String = {"订单编号", "接单日期", "产品名称", "产品颜色".......}
For Each dr3 As DataRow In DataTables("订单明细表").Select("[核销] ='√'")
    Dim dr4 As DataRow = DataTables("明细表归档").AddNew()
    For k As Integer = 0 To Cols3.Length - 1
        dr4(Cols4(k)) = dr3(Cols3(k)) 
    Next 
    dr3.Delete
Next

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110743 积分:563641 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/4/18 16:17:00 [只看该作者]

Dim Cols1() As String = {"订单编号", "接单日期", "产品名称", "面积".......}
Dim Cols2() As String = {"订单编号", "接单日期", "产品名称", "面积".......}
For Each dr1 As DataRow In DataTables("订单主表").Select("[核销] ='√'")
    Dim dr2 As DataRow = DataTables("主表归档").AddNew()
    For i As Integer = 0 To Cols1.Length - 1
        dr2(Cols2(i)) = dr1(Cols1(i)) 
    Next 
Next

Dim Cols3() As String = {"订单编号", "接单日期", "产品名称", "产品颜色".......}
Dim Cols4() As String = {"订单编号", "接单日期", "产品名称", "产品颜色".......}
For Each dr3 As DataRow In DataTables("订单明细表").Select("[核销] ='√'")
    Dim dr4 As DataRow = DataTables("明细表归档").AddNew()
    For k As Integer = 0 To Cols3.Length - 1
        dr4(Cols4(k)) = dr3(Cols3(k)) 
    Next 
Next
DataTables("订单明细表").deletefor("[核销] ='√'")
DataTables("订单主表").deletefor("[核销] ='√'")


 回到顶部