加好友 发短信
等级:婴狐
帖子:40
积分:376
威望:0
精华:0
注册:2012/1/3 17:14:00
|
自动复制数据 Post By:2012/2/2 1:00:00 [只看该作者]
如果"逻辑列名"选择以后进库表,出库表自动复制数据到库存表,如果撒消选择后把复制的数据删除,问题是同样用ID区分,两表碰到同样的ID号,库存表就不知该删那条数据,即不知删除那个表复制到库存表的数据,那么进库表,出库表的公式如何修改?
加上单号来区分两表就不会搞错了,因为两表的单号是以A.代表进库表,B代表出库表的,所以不会重复,但也必须有现在的ID号,能帮我修改一下吗?
还有的就是文件里的窗口未搞好,直接到表里操作
If e.DataCol.Name = "审核" Then If e.DataRow("审核") = True Then Dim nma() As String = {"单号","商品代码","商品类别","商品名称","规格","等级","单位","进库_数量","进库_单价","备注","进库_折扣","仓库名称","仓位","日期","进库_金额","ID1"} 'A表数据来源列 Dim nmb() As String = {"单号","商品代码","商品类别","商品名称","规格","等级","单位","进库_数量","进库_单价","备注","进库_折扣","仓库名称","仓位","日期","进库_金额","ID1"}'表数据接收列 Dim dr As DataRow = DataTables("库存表").AddNew For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next For Each dc As DataCol In DataTables("库存表").DataCols If dc.name ="id" Then dr("id") =e.DataRow("_identify") Else dr("单号") = e.DataRow("单号") dr("日期") = e.DataRow("日期") dr("仓库名称") = e.DataRow("仓库名称") dr("仓位") = e.DataRow("仓位") dr("商品代码") = e.DataRow("商品代码") dr("商品类别") = e.DataRow("商品类别") dr("商品名称") = e.DataRow("商品名称") dr("规格") = e.DataRow("规格") dr("等级") = e.DataRow("等级") dr("单位") = e.DataRow("单位") dr("进库_数量") = e.DataRow("进库_数量") dr("进库_单价") = e.DataRow("进库_单价") dr("备注") = e.DataRow("备注") dr("进库_折扣") = e.DataRow("进库_折扣") dr("进库_金额") = e.DataRow("进库_金额") dr("ID1") = e.DataRow("ID1") End If Next Else Dim tr As DataRow =DataTables("库存表").find("id ="& e.DataRow("_identify") And "ID1 ="& e.DataRow("ID1")) If tr IsNot Nothing Then tr.delete() End If End If End If
|
|