Dim lb11 As WinForm.Label = e.Form.Controls("Label11")
Dim lb12 As WinForm.Label = e.Form.Controls("Label12")
Dim lb13 As WinForm.Label = e.Form.Controls("Label13")
Dim lb14 As WinForm.Label = e.Form.Controls("Label14")
Dim lb15 As WinForm.Label = e.Form.Controls("Label15")
Dim lb16 As WinForm.Label = e.Form.Controls("Label16")
Dim lb17 As WinForm.Label = e.Form.Controls("Label17")
Dim lb19 As WinForm.Label = e.Form.Controls("Label19")
Dim Pc1 As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim tb5 As WinForm.TextBox = e.Form.Controls("TextBox5")
lb11.text =""
lb12.text =""
lb13.text =""
lb14.text =""
lb15.text =""
lb16.text =""
lb17.text =""
lb19.text =""
tb5.text = ""
Pc1.image = GetImage("")
e.Form.Controls("Button2").Enabled = False
e.Form.Controls("Button3").Enabled = False
Dim result As Integer
Dim CardID (0 To 4) As Byte
If Vars("IcDev")<= 0 Then
MessageBox.Show("未连接读写设备!", "提示")
Exit Sub
End If
\'result= dc_card_chr (Vars("IcDev"), 0, CardID(0))
\'If result < 0 Then
\' MessageBox.Show("请放入卡片!" + Cstr(result), "提示")
\' Exit Sub
\'End If
result=DC_find_i_d(Vars("IcDev"))
If result < 0 Then
MessageBox.Show("请检查身份证是否放入!", "提示")
Exit Sub
End If
\'MessageBox.Show("读取身份证信息!", "提示")
Vars("IcID")= DC_start_i_d(Vars("IcDev"))
If Vars("IcID") <0 Then
MessageBox.Show("读取身份证信息失败!", "提示")
Exit Sub
End If
\'MessageBox.Show("读取身份证1!", "提示")
lb11.text =DC_i_d_query_name(Vars("IcID"))
\'MessageBox.Show("读取身份证2!", "提示")
lb12.text =DC_i_d_query_sex(Vars("IcID"))
\'MessageBox.Show("读取身份证3!", "提示")
lb13.text =DC_i_d_query_nation(Vars("IcID"))
\'MessageBox.Show("读取身份证4!", "提示")
lb14.text =DC_i_d_query_birth(Vars("IcID"))
\'MessageBox.Show("读取身份证5!", "提示")
lb15.text =DC_i_d_query_id_number(Vars("IcID"))
\'MessageBox.Show("读取身份证6!", "提示")
lb16.text =DC_i_d_query_address(Vars("IcID"))
\'MessageBox.Show("读取身份证7!", "提示")
lb17.text =DC_i_d_query_expire_day(Vars("IcID"))
\'MessageBox.Show("读取身份证8!", "提示")
lb19.text =DC_i_d_query_department(Vars("IcID"))
Dim FileName(16) As Byte
FileName = System.Text.Encoding.Default.GetBytes("~me.bmp")
\'MessageBox.Show("读取身份证9!", "提示")
result = DC_i_d_query_photo_file(Vars("IcID"),FileName ) \'相片
If result >= 0 Then
Pc1.Image = GetImage("~me.bmp")
Else
MessageBox.Show("读取身份证照片失败!", "提示")
Exit Sub
End If
\'MessageBox.Show("读取身份证照片成功!", "提示")
result=DC_end_i_d(Vars("IcID"))
If result <0 Then
MessageBox.Show("读取身份证信息失败!", "提示")
Exit Sub
End If
\'进行人员表操作
Dim Position1 As Integer
\'Position1 = Tables("人员清单").Find("身份证号码 = \'" & lb15.text & " \' ") \'查找是否存在
Position1 = Tables("人员清单").Find( lb15.text, 0, "身份证号码", False, True, True ) \'查找是否存在
If Position1>=0 Then \'如果此用户存在
e.Form.Controls("Button2").Enabled = True
e.Form.Controls("Button3").Enabled = True
Tables("人员清单").position = position1
\'e.Form.Controls("Groupbox1").visible = True
Dim Position2 As Integer
Position2 = Tables("职工信息").Find(Tables("人员清单").current("身份证号码"), 0, "身份证号码", False, True, True ) \'查找是否存在
If Position2 >=0 Then
Tables("职工信息").position = position2
tb5.text = "有此人员,所属公司:"+Tables("职工信息").current("所属公司")
Else
tb5.text = "职工信息表无此用户"
End If
Else \'如果数据表没有此用户
e.Form.Controls("Button2").Enabled = False
e.Form.Controls("Button3").Enabled = True
\'e.Form.Controls("Groupbox1").visible = False
Dim Position2 As Integer
Position2 = Tables("职工信息").Find(lb15.text, 0, "身份证号码", False, True, True ) \'查找是否存在
If Position2 >=0 Then
Tables("职工信息").position = position2
tb5.text = "有此人员,所属公司:"+Tables("职工信息").current("所属公司")
Else
tb5.text = "职工信息表无此用户"
End If
End If
MessageBox.Show("读取身份证信息成功!", "提示")