If e.DataCol.Name = "SN" Then
Dim nms() As String = {"数量","物料编码","产品型号","类别","配货单号","工单号","订单号","预入库单号","生产完成日期","预计入库日期"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim drs As List(Of DataRow) = DataTables("配货单").Select("[SN] = '" & e.NewValue & "'")
If drs.Count > 0 Then
SystemReady = False
For Each dr As DataRow In drs
Dim ndr As DataRow = e.DataTable.AddNew
If dr("提示") = "扫描完成" Then
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
e.DataRow("提示") = "重复扫描"
dr("提示") = "扫描完成"
Else
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
If e.DataRow("预入库单号") <> e.DataRow("入库单号") Then
e.DataRow("提示") = "非本入库单物料"
Else
e.DataRow("提示") = "扫描完成"
dr("提示") = "扫描完成"
e.DataRow("收货结束时间") = Date.now
End If
End If
Next
e.DataRow.Delete
SystemReady = True
Else
e.DataRow("提示") = "序列号不存在"
End If
End If
End If
还是没有自动增加行