Select Case e.DataCol.Name
Case "调拨单号"
If e.DataRow.Isnull("调拨单号") = False
Dim ns1() As String = {"入库","出库"}
For Each s As String In ns1
Dim fdr As DataRow = DataTables(s & "明细").Find(s & "单号 = '" & e.DataRow("调拨单号") & "'")
If fdr Is Nothing Then
fdr = DataTables(s & "明细").AddNew
fdr(s & "单号") = e.DataRow("调拨单号")
fdr("商品编号") = e.DataRow("商品编号")
fdr("商品名称") = e.DataRow("商品名称")
fdr("规格型号") = e.DataRow("规格型号")
fdr("单位") = e.DataRow("单位")
fdr("单价") = e.DataRow("单价")
fdr("数量") = e.DataRow("数量")
fdr("备注") = e.DataRow("备注")
End If
Next
Next
Case "商品编号","商品名称","规格型号","单位","单价","数量","备注"
If e.DataRow.Isnull("调拨单号") = False
Dim ns1() As String = {"入库","出库"}
For Each s As String In ns1
Dim fdr As DataRow = DataTables(s & "明细").Find(s & "单号 = '" & e.DataRow("调拨单号") & "'")
If fdr IsNot Nothing Then
fdr(e.DataCol.Name) = e.DataRow(e.DataCol.Name)
End If
Next
End If
End Select