Foxtable(狐表)用户栏目专家坐堂 → [求助]产品表中的该行被删除,并自动保存在“产品另存表”中...


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

主题:[求助]产品表中的该行被删除,并自动保存在“产品另存表”中...

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/5 8:46:00 [显示全部帖子]

Dim dr As Row = Tables("窗口1_Table2").Current
If dr IsNot Nothing Then
    If MessageBox.Show("确定要删除该数据吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
        Dim dr1 As DataRow = DataTables("产品另存表").Find("自动编号='" & dr("自动编号") & "'") '判断一下是不是需要排除重复,如果不需要就将代码去除'
        If dr1 Is Nothing Then
            dr1= DataTables("产品另存表").addnew
            For Each cl As Col In Tables("窗口1_Table2").cols
                dr1(cl.Name) = dr(cl.name)
            Next
            dr1.save
            For Each cdr As DataRow In DataTables("订单").Select("产品编号='" & dr("产品编号") & "'")
                dr1= DataTables("订单另存表").addnew
                For Each cl As Col In Tables("订单另存表").cols
                    dr1(cl.Name) = cdr(cl.name)
                Next
            Next
        End If
        dr.delete
    End If
End If

 回到顶部