Dim ddh As WinForm.TextBox = e.Form.Controls("合同号") Dim shk As WinForm.TextBox = e.Form.Controls("款号") Dim dtr5 As String = e.Form.Controls("Ts_8_8").text If shk.text > "" And ddh.text > "" Then Dim filter As String = "合同号 = '" & ddh.Text & "'And 款号 = '" & shk.Text & "' " Dim drZ As List(Of DataRow) = DataTables("订单主表").Select(filter) For Each r As DataRow In drZ Dim Parts() As String = dtr5.Split("+") r("数量") = Parts(0) Next For k As Integer = 1 To 7 For l As Integer = 1 To 7 Dim dr As String = e.Form.Controls("Ts_" & l & "_" & k).text Dim dr2 As String = e.Form.Controls("Tg_" & k).text Dim dr3 As String = e.Form.Controls("Tsy_" & l).text If dr > "" And dr2 > "" And dr3 > "" Then Dim temp As String = filter & " and 颜色 = '" & dr3 & "' and 规格 = '" & dr2 & "'" Dim fdr As DataRow = DataTables("订单数量明细").find(temp) msgbox(temp) If fdr IsNot Nothing Then fdr("数量") = dr Else Dim Tea() As String ={"合同号","款号"} Dim r As Row = Tables("订单数量明细").AddNew For Each TTL As String In Tea r(TTL) = e.Form.Controls(TTL).text Next r("颜色") = dr3 r("规格") = dr2 r("数量") = dr End If End If Next Next If DataTables("订单主表").HasChanges Or DataTables("订单数量明细").HasChanges Then If MessageBox.Show("款号为" & shk.text & "的订单已经被修改,是否保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then DataTables("订单数量明细").Save() DataTables("订单主表").Save() MessageBox.Show("订单更新完成,请打印!") End If End If End If
|