窗口表事件
窗口与控件事件
考勤机注册登记_AfterLoad
MessageBox.show("考勤机注册登记前,请确保设备接通电源并连接网络!","警告!",MessageBoxButtons.OK,MessageBoxIcon.Warning)
If FileSys.FileExists("C:\Windows\System32\zkemkeeper.dll") =False Then
Dim Proc As New Process '定义一个新的Process
Proc.StartInfo.FileName = ProjectPath & "\SDK x86\Register_SDK.bat" '指定要打开的文件
proc.StartInfo.WorkingDirectory = ProjectPath & "\Attachments\"
Proc.Start()
End If
'Dim jqlb As WinForm.ComboBox = e.Form.Controls("机器列表")
'Dim kqjip As WinForm.TextBox = e.Form.Controls("IP")
'Dim kqjsn As WinForm.TextBox = e.Form.Controls("序列号")
Dim fxlb As WinForm.ComboBox = e.Form.Controls("分校列表")
If _usergroup.Contains("管理员组") Then
fxlb.ComboList="所有校区|" & DataTables("分校").SQLGetComboListString("分校名称")
Else
fxlb.ComboList = _Userfxlb
End If
If _kqjIP <>"" Then
fxlb.value=_kqjfx
End If
考勤机注册登记_IP_ValueChanged
Dim kqjip As String=e.Form.Controls("IP").value
Dim kqjsn As String
Dim axCZKEM1 As New zkemkeeper.CZKEM
Dim bIsConnected = axCZKEM1.Connect_Net(kqjip, "4370") '测试机器连接是否正常
If bIsConnected = False Then
MessageBox.show("匹配连接失败,请检查考勤机是否通电并且IP地址是否设置正确!" & kqjip)
e.Form.Controls("IP").value=""
Else
axCZKEM1.GetSerialNumber (0,kqjSN)
e.Form.Controls("序列号").value=kqjsn
e.Form.Controls("状态").value="正常"
MessageBox.Show("IP地址为: " & kqjip & " 的考勤机匹配登记成功,可以正常使用!", "提示")
_KqjIP = e.Form.Controls("IP").value '考勤机IP
_KqjSN = e.Form.Controls("序列号").value '考勤机SN
_KqjFX = e.Form.Controls("分校列表").value '考勤机所属分校
_KqjFXBH = e.Form.Controls("分校编号").value '考勤机所属分校
_KqjZT = "正常" '考勤机当前状态
Registry.SetValue("HKEY_CURRENT_USER\Software\YfshErp","kqjip",_KqjIP)
Registry.SetValue("HKEY_CURRENT_USER\Software\YfshErp","kqjsn",_KqjSN)
Registry.SetValue("HKEY_CURRENT_USER\Software\YfshErp","kqjfx",_Kqjfx)
Registry.SetValue("HKEY_CURRENT_USER\Software\YfshErp","kqjfxbh",_Kqjfxbh)
Registry.SetValue("HKEY_CURRENT_USER\Software\YfshErp","kqjzt",_Kqjzt)
e.Form.Close
End If
考勤机注册登记_分校列表_ValueChanged
Dim fxlb As WinForm.ComboBox = e.Form.Controls("分校列表")
If fxlb.value Is Nothing Or fxlb.value="所有校区" Then
MessageBox.show("请选择需要添加设备的分校!")
Return
End If
e.Form.Controls("分校编号").value=DataTables("分校").SQLFind("分校名称='" & fxlb.value & "'")("分校编号")
e.Form.Controls("登记人").value=_username
e.Form.Controls("登记日期").value=Functions.Execute("服务器时间").Today