Select Case e.DataCol.Name
Case "出库单号"
If e.DataRow("记账") = True Then
If DataTables.Contains(e.DataRow("分配表名")) Then
Dim dh As DataRow = DataTables(e.DataRow("分配表名")).Find("[出库单号] = '" & e.NewValue & "'")
If dh Is Nothing Then
Dim nma() As String = {"物料代码","物料名称","规格型号","常用计量单位","加权平均单价","出库数量","出库金额","出库日期","出库单号","作业项目","成本项目","材料用途","领用人"} 'A表数据来源列
Dim nmb() As String = {"物料代码","物料名称","规格型号","常用计量单位","加权平均单价","出库数量","出库金额","领用日期","出库单号","作业项目","成本项目","材料用途","领用人"} 'B表数据接收列
Dim dr As DataRow = DataTables(e.DataRow("分配表名")).AddNew()
systemready = False
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
systemready = True
End If
End If
End If
End Select
[此贴子已经被作者于2015/6/9 18:03:49编辑过]