Select Case e.DataCol.name
Case "锻件"
If e.DataRow("锻件") = False Then
DataTables("锻铸件清单").DeleteFor("零部件编号='" & e.DataRow("零部件编号") & "'")
Else
Dim ndr As Row = Tables("锻铸件清单").AddNew
ndr("零部件编号") = e.DataRow("零部件编号")
ndr("制单日期") = e.DataRow("制单日期")
ndr("生产令号") = e.DataRow("生产令号")
ndr("项目名称") = e.DataRow("项目名称")
ndr("机组") = e.DataRow("机组")
ndr("零部件名称") = e.DataRow("零部件名称")
ndr("零部件图号") = e.DataRow("零部件图号")
ndr("数量") = e.DataRow("数量")
ndr("材质") = e.DataRow("材质")
ndr("材料批次") = e.DataRow("材料批次")
ndr("零部件标识") = e.DataRow("零部件标识")
ndr.Move(0)
ndr("_sortkey") = DataTables("锻铸件清单").sqlcompute("min([_sortkey])") - 0.00000001
If e.DataRow("规格").Contains("δ") Then
ndr("下料尺寸") = e.DataRow("规格") & "×" & e.DataRow("下料尺寸")
Else
If e.DataRow("规格").Contains("φ") Then
ndr("下料尺寸") = e.DataRow("规格") & "," & e.DataRow("下料尺寸")
Else
ndr("下料尺寸") = e.DataRow("规格")
End If
End If
End If
Case "下料尺寸", "规格"
Dim filter As String
Dim pr As DataRow
filter = "零部件编号 = '" & e.DataRow("零部件编号") & "'"
pr = DataTables("锻铸件清单").Find(filter)
If pr Is Nothing Then
pr = DataTables("锻铸件清单").SQLFind(filter)
End If
If pr IsNot Nothing Then
If e.DataRow("规格").Contains("δ") Then
pr("下料尺寸") = e.DataRow("规格") & "×" & e.DataRow("下料尺寸")
Else
If e.DataRow("规格").Contains("φ") Then
pr("下料尺寸") = e.DataRow("规格") & "," & e.DataRow("下料尺寸")
Else
pr("下料尺寸") = e.DataRow("规格")
End If
End If
pr.save
End If
End Select