Tables("开始生产_table1").AddNew()
Tables("开始生产_table1").Current.DataRow.Load()
Dim aa As Row = Tables("开始生产_table1").current
Dim hh As Long = aa.Index
Dim tj As Long = 0
Dim lrq As Date
lrq = Date.now
Do While tj <= hh-1
Dim gx1 As Row = Tables("开始生产_table1").Rows(tj)
If gx1.Isnull("工价1") Then
Else
Tables("生产排单表").AddNew()
Tables("生产排单表").Current.DataRow.Load()
Dim cr As Row = Tables("生产排单表").current
cr("客户") = gx1("客户")
cr("产品") = gx1("产品")
cr("素材型号") = gx1("素材型号")
cr("数量") = gx1("数量")
cr("工序") = "工序1"
Dim filter As String
Dim cz As DataRow
filter = " [产品名称] = '" & gx1("产品") & "'"
cz = DataTables("产品列表").find(filter)
cr("工序时间")= cz("工序1时间")
cr("换件时间")= cz("换件1时间")
cr("开始日期") = lrq
End If
If gx1.Isnull("工价2") Then
Else
Tables("生产排单表").AddNew()
Tables("生产排单表").Current.DataRow.Load()
Dim cr As Row = Tables("生产排单表").current
cr("客户") = gx1("客户")
cr("产品") = gx1("产品")
cr("素材型号") = gx1("素材型号")
cr("数量") = gx1("数量")
cr("工序") = "工序2"
Dim filter As String
Dim cz As DataRow
filter = " [产品名称] = '" & gx1("产品") & "'"
cz = DataTables("产品列表").find(filter)
cr("工序时间")= cz("工序2时间")
cr("换件时间")= cz("换件2时间")
cr("开始日期") = lrq
End If
If gx1.Isnull("工价3") Then
Else
Tables("生产排单表").AddNew()
Tables("生产排单表").Current.DataRow.Load()
Dim cr As Row = Tables("生产排单表").current
cr("客户") = gx1("客户")
cr("产品") = gx1("产品")
cr("素材型号") = gx1("素材型号")
cr("数量") = gx1("数量")
cr("工序") = "工序3"
Dim filter As String
Dim cz As DataRow
filter = " [产品名称] = '" & gx1("产品") & "'"
cz = DataTables("产品列表").find(filter)
cr("工序时间")= cz("工序3时间")
cr("换件时间")= cz("换件3时间")
cr("开始日期") = lrq
End If
If gx1.Isnull("工价4") Then
Else
Tables("生产排单表").AddNew()
Tables("生产排单表").Current.DataRow.Load()
Dim cr As Row = Tables("生产排单表").current
cr("客户") = gx1("客户")
cr("产品") = gx1("产品")
cr("素材型号") = gx1("素材型号")
cr("数量") = gx1("数量")
cr("工序") = "工序4"
Dim filter As String
Dim cz As DataRow
filter = " [产品名称] = '" & gx1("产品") & "'"
cz = DataTables("产品列表").find(filter)
cr("工序时间")= cz("工序4时间")
cr("换件时间")= cz("换件4时间")
cr("开始日期") = lrq
End If
Dim kh As String =e.Form.controls("combobox1").value
Dim scxh As String = e.Form.controls("combobox2").value
Dim rq As Date = e.Form.controls("combobox3").value
Dim cp As String = gx1("产品")
Dim cc As String
cc = "客户 = '" & kh & "'and 素材型号 = '" & scxh & "' and 日期 = '" & rq & "' and 产品 = '" & cp & "' "
Dim kssc As DataRow
kssc = DataTables("订单").find(cc)
kssc("开始生产")= True
tj=tj+1
Loop