这样么?麻烦老师帮忙修改
Dim dr2 As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "预算编号"
If dr2.IsNull("预算编号") Then
DataTables("原材料采购明细表").DeleteFor("预算编号='" & e.DataRow("预算编号") & "'")
DataTables("机械外购件采购明细表").DeleteFor("预算编号='" & e.DataRow("预算编号") & "'")
DataTables("电气外购件采购明细表").DeleteFor("预算编号='" & e.DataRow("预算编号") & "'")
dr2("当前进展_完成") = False
Else
If dr2.GetChildRows("原材料采购明细表").Count > 0
Dim cnt As Integer = DataTables("原材料采购明细表").Compute("count(预算编号)", "预算编号='" & e.NewValue & "' and (到全 = False )")
If dr2.GetChildRows("机械外购件采购明细表").Count > 0
Dim cnt1 As Integer = DataTables("机械外购件采购明细表").Compute("count(预算编号)", "预算编号='" & e.NewValue & "' and (到全 = False )")
If dr2.GetChildRows("电气外购件采购明细表").Count > 0
Dim cnt2 As Integer = DataTables("电气外购件采购明细表").Compute("count(预算编号)", "预算编号='" & e.NewValue & "' and (到全 = False )")
dr2("当前进展_完成") = (cnt + cnt1 + cnt2 = 0)
End If
End If
End If
End If
End Select