Select Case e.DataCol.Name
Case "入库单号","物料代码"
Dim rkdhs As List (of DataRow)
rkdhs = DataTables("入库单").Select("[入库单号] = '" & e.Datarow("入库单号") & "' And [物料代码] = '" & e.DataRow("物料代码") & "'")
For Each rkdh As DataRow In rkdhs
If rkdhs Is Nothing Then
If e.DataRow("记账") = True Then
Dim nma() As String = {"仓库代码","仓库名称","入库日期","物料代码","物料名称","规格型号","常用计量单位","材料单价","入库数量","入库金额","入库单号"} 'A表数据来源列
Dim nmb() As String = {"仓库代码","仓库名称","入库日期","物料代码","物料名称","规格型号","常用计量单位","材料单价","入库数量","入库金额","入库单号"} 'B表数据接收列
Dim dr As DataRow = DataTables("库存材料表").AddNew()
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
End If
Next
End Select