Select Case e.DataCol.name Case "领料情况_分机组" If e.newvalue = False Then DataTables("领料清单").DeleteFor("编号='" & e.DataRow("编号") & "'") Else If 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.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.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 end if Case "领料情况_不分机组" if e.newvalue = false then DataTables("领料清单").DeleteFor("编号='" & e.DataRow("编号") & "'") else If 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("数量") End If If 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("数量") End If If 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("数量") end if End If End Select
|