Dim cmbgs As WinForm.ComboBox = e.Form.Controls("ComboBox_公司")
Dim txbdm As WinForm.TextBox = e.Form.Controls("TextBox_代码")
Dim cmbgcmc As WinForm.ComboBox = e.Form.Controls("ComboBox_工程名称")
Dim cmbgcdd As WinForm.ComboBox = e.Form.Controls("ComboBox_工程地点")
Dim txbhtlx As WinForm.TextBox = e.Form.Controls("TextBox_合同类型")
Dim txbhtbh As WinForm.TextBox = e.Form.Controls("TextBox_合同编号")
Dim dtpkpsj As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker_开盘时间")
Dim cmbjzff As WinForm.ComboBox = e.Form.Controls("ComboBox_浇注方法")
Dim cmbjzbw As WinForm.ComboBox = e.Form.Controls("ComboBox_浇注部位")
Dim cmbhntbj As WinForm.ComboBox = e.Form.Controls("ComboBox_混凝土标号")
Dim cmbtld As WinForm.ComboBox = e.Form.Controls("ComboBox_塌落度")
Dim ncbjhfl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox_计划方量")
Dim ncbyslc As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox_运输里程")
Dim ncblcdj As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox_里程单价")
Dim txbclpl As WinForm.TextBox = e.Form.Controls("TextBox_车辆及频率")
Dim cmbxflxr As WinForm.ComboBox = e.Form.Controls("ComboBox_需方联系人")
Dim txbxfdh As WinForm.TextBox = e.Form.Controls("TextBox_需方电话")
Dim txbywy As WinForm.TextBox = e.Form.Controls("TextBox_业务员")
Dim txbywydh As WinForm.TextBox = e.Form.Controls("TextBox_业务员电话")
Dim ccbjsyq As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox_其它技术要求")
Dim txbbz As WinForm.TextBox = e.Form.Controls("TextBox_备注")
Dim cmbfhdw As WinForm.ComboBox = e.Form.Controls("ComboBox_发货单位")
Dim cmbjsz As WinForm.ComboBox = e.Form.Controls("ComboBox_接收站")
Dim cbtgfh As WinForm.CheckBox = e.Form.Controls("CheckBox_跳过复核")
Dim rbcg As WinForm.RadioButton = e.Form.Controls("RadioButton_常规")
Dim str As String = "以下内容不可为空或录入内容错误"
If cmbgs.Value = Nothing Then
str = str & vbcrlf & "需方名称"
End If
If txbdm.Value = Nothing Then
str = str & vbcrlf & "需方代码"
End If
If cmbgcmc.Value = Nothing Then
str = str & vbcrlf & "工程名称"
End If
If txbhtlx.Value = Nothing Then
str = str & vbcrlf & "合同类型"
End If
If txbhtbh.Value = Nothing Then
str = str & vbcrlf & "合同编号"
End If
If dtpkpsj.Value = Nothing Then
str = str & vbcrlf & "开盘时间"
End If
If cmbjzff.Value = Nothing Then
str = str & vbcrlf & "浇注方法"
End If
If cmbjzbw.Value = Nothing Then
str = str & vbcrlf & "浇注部位"
End If
If cmbhntbj.Value = Nothing Then
str = str & vbcrlf & "混凝土标号"
End If
If ncbjhfl.Value <= 0 Then
str = str & vbcrlf & "计划方量"
End If
If cmbxflxr.Value = Nothing Then
str = str & vbcrlf & "需方联系人"
End If
If txbxfdh.Value = Nothing Then
str = str & vbcrlf & "需方电话"
End If
If rbcg.Checked = False Then
If ncbyslc.Value = Nothing Then
str = str & vbcrlf & "运输里程"
End If
End If
If str <> "以下内容不可为空或录入内容错误" Then
MessageBox.Show(str,"错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
Return
End If
Dim dr As DataRow
If QQClient.Ready = False Then
PopMessage("服务端未启动,无法生成单号!","提示",PopIconEnum.Infomation,5)
Else
Dim cmd As New SQLCommand
Dim dt As Date
cmd.C
cmd.CommandText = "Select GetDate()"
dt = cmd.ExecuteScalar()
Dim dqsj As Date = Format(dt, "yyyy-MM-dd HH:mm:ss")
'Dim dqsj As Date = Date.Now
Dim bh As String = Format(dqsj,"yyyyMMdd")
Dim rt As String = QQClient.SendWait(":x" & bh & "x:")
Dim id As Integer
If rt > "" Then
If Integer.TryParse(rt,id) Then
dr = _dt生产任务通知.AddNew
dr("单号") = "SCXD-" & bh & "-" & Format(id,"000")
dr("录入人") = _UserName
dr("录入时间") = Format(dt, "yyyy-MM-dd HH:mm:ss")
dr("公司") = cmbgs.Value
dr("代码") = txbdm.Value
dr("工程名称") = cmbgcmc.Value
dr("工程地点") = cmbgcdd.Value
dr("合同类型") = txbhtlx.Value
dr("合同") = txbhtbh.Value
dr("开盘时间") = dtpkpsj.Value
dr("浇注方法") = cmbjzff.Value
dr("浇注部位") = cmbjzbw.Value
dr("混凝土标号") = cmbhntbj.Value
dr("塌落度") = cmbtld.Value
dr("运输里程") = ncbyslc.Value
dr("里程单价") = ncblcdj.Value
dr("计划方量") = ncbjhfl.Value
dr("车辆及频率") = txbclpl.Value
dr("需方联系人") = cmbxflxr.Value
dr("需方电话") = txbxfdh.Value
dr("业务员") = txbywy.Value
dr("业务员电话") = txbywydh.Value
dr("其它技术要求") = ccbjsyq.Value
dr("备注") = txbbz.Value
dr("发货单位") = cmbfhdw.Value
dr("接收站") = cmbjsz.Value
If cbtgfh.Checked = True Then
dr("复核人") = _UserName
dr("复核时间") = Date.Now
dr("复核意见") = "通过"
PopMessage("单号:" & dr("单号") & vbcrlf & "可在待收单中查看","提示:生成新的通知单号",PopIconEnum.Infomation,5)
Else
PopMessage("单号:" & dr("单号") & vbcrlf & "可在待复核中查看","提示:生成新的通知单号",PopIconEnum.Infomation,5)
End If
dr.Save
Else
PopMessage("服务器返回错误信息:" & rt,"提示",PopIconEnum.Infomation,5)
End If
Else
PopMessage("服务器无响应,无法生成编号!","提示",PopIconEnum.Infomation,5)
End If
End If