Dim drs As List(Of DataRow) = DataTables("销售订单明细").Select("订单单号 = " & "\'" & e.form.controls("combobox1").text & "\'" )
If Tables("销售发货.销售发货明细").AllowEdit = True Then
For Each dr As DataRow In drs
\'If DataTables("销售发货明细").Find("发货单号 = \'" & dr("发货单号") & "\' And 产品代码 = \'" & dr("产品代码 ") & "\'And 颜色 = \'" & dr("颜色") & "\'") IsNot Nothing Then
If DataTables("销售发货明细").Find("订单单号 = \'" & dr("订单单号") & "\' And 产品代码 = \'" & dr("产品代码 ") & "\'And 颜色 = \'" & dr("颜色") & "\'") IsNot Nothing Then
MessageBox.Show("不要重复录入!","提示")
Return
End If
If Tables("销售发货.销售发货明细").current("订单单号").substring(2) <> Tables("销售发货.销售发货明细").current("发货单号").substring(2)
Tables("销售发货.销售发货明细").Current.Delete
MessageBox.Show("订单单号不对!", "提示")
Return
Else
Dim ndr As Row = Tables("销售发货.销售发货明细").addnew
ndr("订单单号")= dr("订单单号")
ndr("产品代码")= dr("产品代码")
ndr("客户代码")= dr("客户代码")
ndr("颜色")= dr("颜色")
ndr("单位")= dr("单位")
ndr("单价")= dr("单价")
ndr("订单数量")= dr("订单数量")
ndr("发货数量")= dr("订单数量")
ndr("备注")= dr("备注")
End If
Next
Else
e.Cancel = True \'取消动作
End If