代码如下: 大神给看看哪里出错了? 录入不进去
Dim gznr As String = e.Form.Controls("TextBox1").Value
Dim sqr As String = e.Form.Controls("ComboBox1").Value
Dim fpg As String = e.Form.Controls("ComboBox2").Value
Dim cpmc As String = e.Form.Controls("ComboBox3").Value
Dim cpxh As String = e.Form.Controls("ComboBox4").Value
Dim gzlx As String = e.Form.Controls("ComboBox5").Value
Dim cfqy As String = e.Form.Controls("ComboBox6").Value
Dim pbx As WinForm.PictureBox
Dim kssj As WinForm.DateTimePicker
kssj = e.Form.Controls("DateTimePicker2")
Dim jzsj As WinForm.DateTimePicker
jzsj = e.Form.Controls("DateTimePicker1")
Dim d As Date = Date.Today()
Dim dr1 As DataRow
If gznr = "" Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请输入工作内容,不能为空!"
ElseIf sqr = "" Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请输入申请人,不能为空!"
ElseIf fpg = "" Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请输入分配给,不能为空!"
ElseIf gzlx = "" Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请输入工作类型,不能为空!"
ElseIf cfqy = "" Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请输入存放区域,不能为空!"
ElseIf kssj Is Nothing Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请选择开始时间,不能为空!"
ElseIf jzsj Is Nothing Then
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\32 (48).png")
e.Form.Controls("信息提示").Text = "请选择截止时间,不能为空!"
dr1 = DataTables("任务信息").AddNew()
dr1("工作内容") = gznr
dr1("产品名称") = cpmc
dr1("申请人") = sqr
dr1("分配给") = fpg
dr1("产品型号") = cpxh
dr1("工作类型") = gzlx
dr1("存放区域") = cfqy
dr1("开始时间") = kssj
dr1("截止时间") = jzsj
DataTables.Save()
e.Form.Controls("TextBox1").Value = ""
e.Form.Controls("ComboBox1").Value = ""
e.Form.Controls("ComboBox2").Value = ""
e.Form.Controls("ComboBox3").Value = ""
e.Form.Controls("ComboBox4").Value = ""
e.Form.Controls("ComboBox5").Value = ""
e.Form.Controls("ComboBox6").Value = ""
pbx = e.form.Controls("PictureBox16")
pbx.Image = GetImage("Images\Clear Green Button.png")
e.Form.Controls("信息提示").Text = "任务输入成功!"
End If