📄 frm4.frm
字号:
X2 = 3480
Y1 = 3000
Y2 = 3120
End
Begin VB.Line Line15
X1 = 3120
X2 = 3600
Y1 = 2640
Y2 = 2640
End
Begin VB.Line Line14
X1 = 3600
X2 = 3480
Y1 = 2640
Y2 = 2520
End
Begin VB.Line Line13
X1 = 3600
X2 = 3480
Y1 = 2640
Y2 = 2760
End
Begin VB.Line Line12
X1 = 3120
X2 = 3600
Y1 = 2280
Y2 = 2280
End
Begin VB.Line Line11
X1 = 3600
X2 = 3480
Y1 = 2280
Y2 = 2160
End
Begin VB.Line Line10
X1 = 3600
X2 = 3480
Y1 = 2280
Y2 = 2400
End
Begin VB.Line Line9
X1 = 3120
X2 = 3600
Y1 = 1920
Y2 = 1920
End
Begin VB.Line Line8
X1 = 3600
X2 = 3480
Y1 = 1920
Y2 = 1800
End
Begin VB.Line Line7
X1 = 3600
X2 = 3480
Y1 = 1920
Y2 = 2040
End
Begin VB.Line Line6
X1 = 3600
X2 = 3480
Y1 = 1560
Y2 = 1680
End
Begin VB.Line Line5
X1 = 3600
X2 = 3480
Y1 = 1560
Y2 = 1440
End
Begin VB.Line Line4
X1 = 3120
X2 = 3600
Y1 = 1560
Y2 = 1560
End
Begin VB.Line Line3
X1 = 3600
X2 = 3480
Y1 = 1200
Y2 = 1320
End
Begin VB.Line Line2
X1 = 3480
X2 = 3600
Y1 = 1080
Y2 = 1200
End
Begin VB.Line Line1
X1 = 3120
X2 = 3600
Y1 = 1200
Y2 = 1200
End
Begin VB.Label Label7
Caption = "Sun."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 10
Top = 720
Width = 615
End
Begin VB.Label Label6
Caption = "Sat."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 9
Top = 2880
Width = 495
End
Begin VB.Label Label5
Caption = "Friday"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 8
Top = 2520
Width = 615
End
Begin VB.Label Label4
Caption = "Thurs."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 7
Top = 2160
Width = 615
End
Begin VB.Label Label3
Caption = "Wed."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 6
Top = 1800
Width = 495
End
Begin VB.Label Label2
Caption = "Tues."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 5
Top = 1440
Width = 615
End
Begin VB.Label Label1
Caption = "Mon."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 4
Top = 1080
Width = 615
End
End
Attribute VB_Name = "frm4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**********************************************
'Time:2005-7-30 *
'purpose:Demo for access control *
'author:YongHong Pei,work for zksoftware *
'contact:pyhppp@hotmail.com *
'**********************************************
'follow code get access testing by zkemsdk 5.10.90
' a user pertain to a group(default 1),Group has TZ(3,tz1 or tz2 tz3),user has TZ(tz1 or tz2 or tz3).
' one tz is hebdomad(1-99).
Private Sub cdmGUGroup_Click()
Dim userGrp As Long
Dim bGUG As Boolean
bGUG = frm2.CZKEM1.GetUserGroup(frm2.txtMachNum.Text, txtSUGID.Text, userGrp)
If bGUG Then
lsUserGroup.AddItem "user" & txtSUGID.Text & "'s" & " group is " & CStr(userGrp)
End If
End Sub
Private Sub cmdGetGrpTZ_Click()
Dim TZS As String
Dim bGetGrpTz As Boolean
'One group has three TZs,mesns tz1 or tz2 or tz3,not and
bGetGrpTz = frm2.CZKEM1.GetGroupTZStr(CLng(frm2.txtMachNum.Text), CLng(cmbSGroupID.Text), TZS)
If bGetGrpTz Then
lsGrpTZ.AddItem "Group" & CStr(cmbSGroupID.Text) & "TZs-" & TZS
End If
End Sub
Private Sub cmdGetTzInfo_Click()
Dim bGTz As Boolean
Dim tz As String
Dim strTemp As String
lstTz.Clear
bGTz = frm2.CZKEM1.GetTZInfo(CLng(frm2.txtMachNum.Text), CLng(txtTzIndex.Text), tz)
If bGTz Then
'hebdomad
For i = 0 To 6
strTemp = week(i) & Mid(tz, i * 8 + 1, 4) & "-" & Mid(tz, i * 8 + 5, 4)
lstTz.AddItem strTemp
Next
End If
End Sub
Private Sub cmdGetUnlockGrp_Click()
Dim grps As String
Dim bGetUnlocdGrp As Boolean
Dim stemp As String
Dim stemp1 As String
Dim i As Long
Dim j As Long
bGetUnlocdGrp = frm2.CZKEM1.GetUnlockGroups(CLng(frm2.txtMachNum.Text), grps)
If bGetUnlocdGrp Then
j = 1
'10 groups,partition by ':'
For i = 1 To Len(grps)
stemp1 = Mid(grps, i, 1)
If stemp1 <> ":" Then
stemp = stemp & stemp1
If i = Len(grps) And j = 10 Then
lsUnlockGrp.AddItem "Groups 10" & " - " & stemp
End If
ElseIf stemp1 = ":" Then
lsUnlockGrp.AddItem "Groups " & j & "" & " - " & stemp
lsUnlockGrp.Refresh
j = j + 1
stemp = ""
If i = Len(grps) Then
lsUnlockGrp.AddItem "Groups 10" & " - " & " "
End If
End If
Next
End If
End Sub
Private Sub cmdGetUserTzInfo_Click()
Dim TZS As String
Dim bGetTZ As Boolean
If IsNumeric(txtUserID) Then
bGetTZ = frm2.CZKEM1.GetUserTZStr(CLng(frm2.txtMachNum.Text), CLng(txtUserID.Text), TZS)
If bGetTZ Then
lsUserTZ.AddItem "User " & txtUserID.Text & " - " & TZS
End If
End If
End Sub
Private Sub cmdOpenDoor_Click()
'Open a door controling by machine, the number is frm2.txtMachiNum.text
frm2.CZKEM1.ACUnlock CLng(frm2.txtMachNum.Text), 100
End Sub
Private Sub cmdSetGroupStr_Click()
Dim TZS
Dim bSGrpTZ As Boolean
TZS = txtGrpTZ1.Text & ":" & txtGrpTZ2.Text & ":" & txtGrpTZ3.Text
bSGrpTZ = frm2.CZKEM1.SetGroupTZStr(CLng(frm2.txtMachNum.Text), CLng(cmbSGroupID.Text), TZS)
If bSGrpTZ Then
MsgBox "set group TZ successful", vbOKOnly, "Info"
Else
MsgBox "set group TZ fail", vbOKOnly, "Info"
End If
End Sub
Private Sub cmdSetUnlockGroups_Click()
Dim grps
Dim bSetUnlockGrp As Boolean
grps = txtGrp1.Text & ":" & txtGrp2.Text & ":" & txtGrp3.Text & ":" & txtGrp4.Text & ":" & txtGrp5.Text & ":"
grps = grps & txtGrp6.Text & ":" & txtGrp7.Text & ":" & txtGrp8.Text & ":" & txtGrp9 & ":" & txtGrp10.Text
bSetUnlockGrp = frm2.CZKEM1.SetUnlockGroups(CLng(frm2.txtMachNum.Text), grps)
If bSetUnlockGrp Then
MsgBox "Set unlock groups successful", vbOKOnly, "Info"
Else
MsgBox "Set unlock groups fail", vbOKOnly, "Info"
End If
End Sub
Private Sub cmdSetUserGroup_Click()
Dim bsetGp As Boolean
bsetGp = frm2.CZKEM1.SetUserGroup(CLng(frm2.txtMachNum.Text), CLng(txtSUGID.Text), CLng(cmbGroupID.Text))
If bsetGp Then
MsgBox "set user group successful", vbOKOnly, "Info"
Else
MsgBox "set user group fail", vbOKOnly, "Info"
End If
End Sub
Private Sub cmdSeuUserTzInfo_Click()
Dim TZS
Dim bSetTZ As Boolean
If txtUserID.Text = "" Then Exit Sub
If IsNumeric(txtUserID.Text) Then
TZS = txtTZ1.Text & ":" & txtTZ2.Text & ":" & txtTZ3.Text
bSetTZ = frm2.CZKEM1.SetUserTZStr(CLng(frm2.txtMachNum.Text), CLng(txtUserID.Text), TZS)
If bSetTZ Then
MsgBox "set user tz successful", vbOKOnly, "Info"
Else
MsgBox "set user tz fail", vbOKOnly, "info"
End If
End If
End Sub
Private Sub cmdTzInfo_Click()
Dim strTime
Dim bSetTZ As Boolean
If txtTzIndex.Text = "" Then Exit Sub
strTime = txt7.Text & txt77.Text & txt1.Text & txt11.Text & txt2.Text & txt22.Text & txt3.Text & txt33.Text & txt4.Text & txt44.Text
strTime = strTime & txt5.Text & txt55.Text & txt6.Text & txt66.Text
bSetTZ = frm2.CZKEM1.SetTZInfo(CLng(frm2.txtMachNum.Text), CLng(txtTzIndex.Text), strTime)
If bSetTZ Then
MsgBox "set TZ info successful!", vbOKOnly, "successful"
Else
MsgBox "set TZ info fail!", vbOKOnly, "fail"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -