请教
Select Case e.DataCol.name
Case "领料情况_分机组"
If e.newvalue = True AndAlso e.DataRow("物资说明") = "外购件" Then
For i As Integer = 1 To 2
Dim ndr As DataRow = DataTables("领料清单").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("到货数量") / 2
Next
End If
If e.newvalue = True AndAlso e.DataRow("物资说明") = "电气" Then
For i As Integer = 1 To 2
Dim ndr As DataRow = DataTables("领料清单").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("到货数量") / 2
Next
End If
If e.newvalue = True AndAlso e.DataRow("物资说明") = "焊材" Then
For i As Integer = 1 To 2
Dim ndr As DataRow = DataTables("领料清单").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("到货数量") / 2
Next
End If
Case "领料情况_不分机组"
If e.newvalue = True AndAlso e.DataRow("物资说明") = "外购件" Then
Dim ndr1 As DataRow = DataTables("领料清单").AddNew
ndr1("编号") = e.DataRow("编号")
ndr1("预算编号") = e.DataRow("预算编号")
ndr1("生产令号") = e.DataRow("生产令号")
ndr1("项目名称") = e.DataRow("项目名称")
ndr1("物资说明") = e.DataRow("物资说明")
ndr1("名称") = e.DataRow("物资名称")
ndr1("规格") = e.DataRow("规格")
ndr1("材质") = e.DataRow("材质")
ndr1("单位") = e.DataRow("单位")
ndr1("领料数量") = e.DataRow("数量")
Else
DataTables("领料清单").DeleteFor("编号='" & e.DataRow("编号") & "'")
End If
If e.newvalue = True AndAlso e.DataRow("物资说明") = "电气" Then
Dim ndr1 As DataRow = DataTables("领料清单").AddNew
ndr1("编号") = e.DataRow("编号")
ndr1("预算编号") = e.DataRow("预算编号")
ndr1("生产令号") = e.DataRow("生产令号")
ndr1("项目名称") = e.DataRow("项目名称")
ndr1("物资说明") = e.DataRow("物资说明")
ndr1("名称") = e.DataRow("物资名称")
ndr1("规格") = e.DataRow("规格")
ndr1("材质") = e.DataRow("材质")
ndr1("单位") = e.DataRow("单位")
ndr1("领料数量") = e.DataRow("数量")
Else
DataTables("领料清单").DeleteFor("编号='" & e.DataRow("编号") & "'")
End If
If e.newvalue = True AndAlso e.DataRow("物资说明") = "焊材" Then
Dim ndr1 As DataRow = DataTables("领料清单").AddNew
ndr1("编号") = e.DataRow("编号")
ndr1("预算编号") = e.DataRow("预算编号")
ndr1("生产令号") = e.DataRow("生产令号")
ndr1("项目名称") = e.DataRow("项目名称")
ndr1("物资说明") = e.DataRow("物资说明")
ndr1("名称") = e.DataRow("物资名称")
ndr1("规格") = e.DataRow("规格")
ndr1("材质") = e.DataRow("材质")
ndr1("单位") = e.DataRow("单位")
ndr1("领料数量") = e.DataRow("数量")
Else
DataTables("领料清单").DeleteFor("编号='" & e.DataRow("编号") & "'")
End If
End Select
问题一:Case "领料情况_分机组"下,勾选取消后,领料清单中也自动删除,怎么编?
问题二:Case "领料情况_不分机组",("物资说明") = "焊材"时可实现,但=“外购件”和“电气”时,就没反应,是什么问题?