Select Case e.DataCol.Name
Case "部品ID"
Dim dr As DataRow = e.DataRow
If dr.IsNull("部品ID") Then
dr("工序序号") = Nothing
dr("工程") = Nothing
Else
Dim filter As String
filter = "部品ID = \'" & dr("部品ID") & "\' and 工序序号 Is Not null"
Dim drs As List(Of DataRow) = DataTables("工程和工时").Select(filter, "工序序号")
Systemready = False
For i As Integer = 0 To drs.count - 1
If i > 0 Then
dr = e.DataTable.addnew()
End If
Dim pr = drs(i)
dr("部品ID") = pr("部品ID")
dr("工序序号") = pr("工序序号")
dr("工程") = pr("工程")
dr("备注") = pr("备注")
dr("投入数量") = "1"
dr("任务名称") = pr("部品ID") + " " + pr("备注")
dr("工程耗时H") = pr("装") / 60
Next
Systemready = True
End If
End Select