Select Case lb.text
Case "2"
Dim rr1 As DataRow = DataTables("assemblyMiddle").SQLFind("item_ID = '" & e.DataRow("SN") & "'")
If rr1 IsNot Nothing Then
msgbox(0)
Dim rr2s As List(of DataRow) = DataTables("assemblyMiddle").SQLSelect("id_Flag = '" & rr1("id_Flag") & "'")----想把这个集合的每行按照顺序加入到扫描配货明细表里面
For Each rr2 As DataRow In rr2s
msgbox(1)
Dim dr1 As DataRow = DataTables("assemblyProduct").SQLFind("deviceCode = '" & rr2("item_ID") & "' or productno = '" & rr2("item_ID") & "'")
If dr1 IsNot Nothing Then
msgbox(2)
e.DataRow("SN") = rr2("item_ID")
msgbox(3)
Dim dr2 As DataRow = DataTables("assemblySubWorkOrder").SQLFind("SID = '" & dr1("subWorkOrder") & "'")
If dr2 IsNot Nothing Then
msgbox(4)
e.DataRow("工单行号") = dr2("LineFlag")
Dim dr3 As DataRow = DataTables("assemblyWorkOrder").SQLFind("Id = '" & dr2("workOrder") & "'")
If dr3 IsNot Nothing Then
msgbox(5)
e.DataRow("生产订单号码") = dr3("WorkOrderNo")
e.DataRow("生产订单号码工单行号")= e.DataRow("生产订单号码") & "-" & e.DataRow("工单行号")
msgbox(6)
Dim dr4 As DataRow = DataTables("计划表").SQLFind("生产订单号码 = '" & e.DataRow("生产订单号码") & "' and 工单行号 = '" & e.DataRow("工单行号") & "'")
If dr4 IsNot Nothing Then
e.DataRow("物料编码") = dr4("物料编码")
e.DataRow("物料名称") = dr4("物料名称")
e.DataRow("类别说明") = dr4("类别说明")
e.DataRow("产品批次") = dr4("产品批次")
e.DataRow("订单号") = dr4("订单号")
e.DataRow("订单行号") = dr4("订单行号")
e.DataRow("客户") = dr4("客户")
e.DataRow("备注") = dr4("备注")
e.DataRow("软件版本") = dr4("软件版本")
e.DataRow("生产扫描员") = scsmy.text
End If
Tables("扫描配货明细").AddNew-----只是增加了行,每列的变化仍然处于第一行。
End If
End If
End If
Next
End If