Dim htdh As WinForm.TextBox = e.Form.Controls("合同单号")
'Dim zxdm As WinForm.TextBox = e.Form.Controls("纸箱代码")
'Dim xxms As WinForm.TextBox = e.Form.Controls("箱型描述")
'If htdh.value="" Or zxdm.value="" Or xxms.value=""Then
'Dim ddsl As WinForm.Label = e.Form.Controls("订单数量")
If htdh.value=""Then
MessageBox.Show("请完善订单信息!","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
If MessageBox.Show("是否保存?","确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) = DialogResult.OK Then
If Tables("订单明细").Current("是否订片") = False Then
Dim nma() As String = {"编号","材质","客户单位","楞型","纸片供应商","箱_长","箱_宽","箱_高","箱型","组合方式","数量"}
Dim nmb() As String = {"生产单号","纸片材质","纸箱客户","纸片楞型","供应厂商","箱_长","箱_宽","箱_高","箱_型","箱_组","箱_数"}
Dim dr As DataRow = DataTables("纸片整理").Find("生产单号 = '" & Tables("订单明细").Current("编号") & "'")
If dr Is Nothing Then
dr = DataTables("纸片整理").AddNew
End If
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = Tables("订单明细").Current(nma(i))
Next
End If
For Each dt As DataTable In DataTables
dt.Save()
Next
systemready = False
Tables("订单明细").AddNew()
systemready = True
End If
End If