\'判断值是否为空,若为空,则没必要往下走
\'姓名
If name = "" Then
e.Form.Controls("name").Error="姓名不允许为空"
Return
Else
name = name.Replace(" ","")
End If
\'\'身份证号
If cardID = "" Then
e.Form.Controls("cardID").Error="身份证号不允许为空"
Return
Else
cardID = cardID.Replace(" ","")
End If
\'\'年龄
\'If age = "" Then
\'e.Form.Controls("age").Error="年龄不允许为空"
\'Return
\'\'Else
\'\'age = age.Replace(" ","")
\'End If
\'出生日期
If e.Form.Controls("birth").Value Is Nothing Then
e.Form.Controls("birth").Error="出生年月不允许为空"
Return
Else
birth = e.Form.Controls("birth").Value
End If
\'\'性别
If sex = "" Then
e.Form.Controls("sex").Error="单位不允许为空"
Return
Else
sex = sex.Replace(" ","")
End If
\'\'联系方式
If tel = "" Then
e.Form.Controls("tel").Error="联系电话不允许为空"
Return
Else
tel = tel.Replace(" ","")
End If
\'\'籍贯
If jiguan = "" Then
e.Form.Controls("jiguan").Error="籍贯不允许为空"
Return
Else
jiguan = jiguan.Replace(" ","")
End If
\'\'健康状况
If health = "" Then
e.Form.Controls("health").Error="健康状况不允许为空"
Return
Else
health = health.Replace(" ","")
End If
\'民族
If ratirational").Error="民族不允许为空"
Return
Else
rational = rational.Replace(" ","")
End If
\'\'入党时间
If e.Form.Controls("partyTime").Value Is Nothing Then
partyTime = Nothing
End If
\'\'政治面貌
If politicalStatus = "" Then
e.Form.Controls("politicalStatus").Error="政治面貌不允许为空"
Return
Else
politicalStatus = politicalStatus.Replace(" ","")
End If
\'\'离退休状态
If leaOrRetire = "" Then
e.Form.Controls("leaOrRetire").Error="离退休状态不允许为空"
Return
Else
leaOrRetire = leaOrRetire.Replace(" ","")
End If
\'\'学历
If edu = "" Then
e.Form.Controls("edu").Error="学历不允许为空"
Return
Else
edu = edu.Replace(" ","")
End If
\'\'单位
If organName = "" Then
e.Form.Controls("organName").Error="单位不允许为空"
Return
Else
organName = organName.Replace(" ","")
End If
\'\'部门
If retiredDep = "" Then
e.Form.Controls("retiredDep").Error="部门不允许为空"
Return
Else
retiredDep = retiredDep.Replace(" ","")
End If
\'\'职务
If retiredPost = "" Then
e.Form.Controls("retiredPost").Error="离退休职务不允许为空"
Return
Else
retiredPost = retiredPost.Replace(" ","")
End If
\'离退休时间
If e.Form.Controls("retireTime").Value Is Nothing Then
e.Form.Controls("retireTime").Error="离退休时间不允许为空"
Return
Else
retireTime = e.Form.Controls("retireTime").Value
End If
\'\'专业技术职务
If proTecPost = "" Then
e.Form.Controls("proTecPost").Error="专业技术职务不允许为空"
Return
Else
proTecPost = proTecPost.Replace(" ","")
End If
\'参加工作日期
If e.Form.Controls("workdate").Value Is Nothing Then
e.Form.Controls("workdate").Error="参加工作时间不允许为空"
Return
Else
workdate = e.Form.Controls("workdate").Value
End If
\'\'地址
If address = "" Then
e.Form.Controls("address").Error="地址不允许为空"
Return
Else
address = address.Replace(" ","")
End If
\'\'处理照片
\'Dim ImageString As String
Dim ImageByte() As Byte
If e.Form.Controls("PictureBox1").ImageFile Is Nothing Then
\'Messagebox.show("照片为空","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
\'Else
Dim fl As String = e.Form.Controls("PictureBox1").ImageFile
Dim fs As New IO.FileStream(fl, IO.FileMode.Open , IO.FileAccess.Read) \'用文件流打开图片
Dim br As New IO.BinaryReader(fs) \'根据文件流,申明一个二进制阅读器
\'Dim ImageByte() As Byte = br.ReadBytes(fs.Length) \'阅读器读取文件流,并将独到的二进制放入数组ImageByte中,
ImageByte = br.ReadBytes(fs.Length) \'阅读器读取文件流,并将独到的二进制放入数组ImageByte中,
\'ImageString = BitConverter.ToString(imageByte).Replace("-", "") \' SQLCommand 不能直接Insert 二进制,只能拼接SQL语句,所以这里把二进制变成字符
End If
\'
\'打开家庭信息页面
Messagebox.show("基本信息已填写完成,请填写附加信息!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
tab.SelectedIndex = 1