Dim Filter As String = "检验批编号 = '" & e.DataRow("检验批编号") & "'"
Dim Filter1 As String = "检验批编号 = '" & e.DataRow("检验批编号") & "'and 班组 <> '"& "下料" &"'"
Dim drs1 As List(Of DataRow) = DataTables("无损_构件清单").SQLSelect(Filter)
Dim drs2 As List(Of DataRow) = DataTables("无损_检测明细").SQLSelect(Filter)
Dim drs3 As List(Of DataRow) = DataTables("无损_检测明细").SQLSelect(Filter1)
Select Case e.DataCol.Name
Case "检验批"
For Each dr1 As DataRow In drs1
dr1("检验批") = e.DataRow("检验批")
dr1.Save
Next
For Each dr2 As DataRow In drs2
dr2("检验批") = e.DataRow("检验批")
dr2.Save
Next
Case "车间"
If e.OldValue = "" Then
For Each dr1 As DataRow In drs1
dr1("车间") = e.DataRow("车间")
dr1.Save
Next
Else
Dim Result As DialogResult = MessageBox.Show("是否将明细表数据全部更改(不包含下料组)","提示",MessageBoxButtons.YesNo)
For Each dr1 As DataRow In drs1
dr1("车间") = e.DataRow("车间")
dr1.Save
Next
If Result = DialogResult.Yes Then
For Each dr2 As DataRow In drs2
dr2("车间") = e.DataRow("车间")
dr2.Save
Next
Else
Return
End If
End If
Case "班组"
If e.OldValue Is Nothing Then
For Each dr1 As DataRow In drs1
dr1("班组") = e.DataRow("班组") '修改构件清单表
dr1.Save
Next
Else
Dim Result As DialogResult = MessageBox.Show("是否将明细表数据全部更改(不包含下料组)","提示",MessageBoxButtons.YesNo)
If Result = DialogResult.Yes Then
'SystemReady = False
For Each dr1 As DataRow In drs1
dr1("班组") = e.DataRow("班组") '修改构件清单表
dr1.Save
Next
For Each dr3 As DataRow In drs3
dr3("班组") = e.DataRow("班组") '修改检测明细表(不包含班组等于下料组的行)
dr3.Save
Next
'SystemReady = True
ElseIf Result = DialogResult.No Then
'SystemReady = False
For Each dr1 As DataRow In drs1
dr1("班组") = e.DataRow("班组")
dr1.Save
Next
'SystemReady = True
Else
Return
End If
'DataTables("无损_构件清单").SQLUpdate(drs1)
'DataTables("无损_检测明细").SQLUpdate(drs2)
'DataTables("无损_检测明细").SQLUpdate(drs3)
End If
End Select