📄 frmbatchwritecard.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmBatchWriteCard
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 3945
ClientLeft = 45
ClientTop = 450
ClientWidth = 3675
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3945
ScaleWidth = 3675
ShowInTaskbar = 0 'False
Begin VB.CommandButton comAllClear
Caption = "全清"
Height = 375
Left = 2430
TabIndex = 5
Top = 630
Width = 1050
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 2430
TabIndex = 3
Top = 1530
Width = 1050
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 375
Left = 2430
TabIndex = 2
Top = 1080
Width = 1050
End
Begin VB.CommandButton cmdAllSelect
Caption = "全选"
Height = 375
Left = 2430
TabIndex = 1
Top = 180
Width = 1050
End
Begin MSComctlLib.ListView lstEmployee
Height = 3345
Left = 135
TabIndex = 0
Top = 135
Width = 2040
_ExtentX = 3598
_ExtentY = 5900
View = 2
LabelWrap = -1 'True
HideSelection = -1 'True
Checkboxes = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.Label lblPos
AutoSize = -1 'True
Caption = "当前写卡位置:"
Height = 195
Left = 135
TabIndex = 4
Top = 3600
Width = 1125
End
End
Attribute VB_Name = "frmBatchWriteCard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim PWD As String
Private Sub cmdAllSelect_Click()
Dim i As Integer
If lstEmployee.ListItems.Count > 0 Then
For i = 1 To lstEmployee.ListItems.Count
lstEmployee.ListItems(i).Checked = True
Next
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim i As Integer
Dim j As Integer
Dim CheckCount As Integer
CheckCount = 0
If lstEmployee.ListItems.Count > 0 Then
For i = 1 To lstEmployee.ListItems.Count
If lstEmployee.ListItems(i).Checked Then
CheckCount = CheckCount + 1
End If
Next
End If
If lstEmployee.ListItems.Count > 0 Then
For i = 1 To lstEmployee.ListItems.Count
If lstEmployee.ListItems(i).Checked Then
j = j + 1
MDI.KQJ.WriteCardStandard lstEmployee.ListItems(i).Tag, dHex
MDI.KQJ.LoginCard PWD
lblPos.Caption = "当前写卡位置:" & lstEmployee.ListItems(i).Text
If i = CheckCount Then
Message "完成!"
lblPos.Caption = "当前写卡位置:"
Else
Message "下一张!"
End If
End If
Next
If j = 0 Then
Message "没有选择员工!"
Exit Sub
End If
Else
Message "没有可用员工!"
Exit Sub
End If
End Sub
Private Sub comAllClear_Click()
Dim i As Integer
If lstEmployee.ListItems.Count > 0 Then
For i = 1 To lstEmployee.ListItems.Count
lstEmployee.ListItems(i).Checked = False
Next
End If
End Sub
Private Sub Form_Load()
Me.Icon = MDI.Icon
Me.Caption = "批量写卡"
PWD = Trim(frmCardConfig.txtEnrollPassword.Text)
Dim i As Integer
If rstEmployee.RecordCount <> 0 Then
rstEmployee.MoveFirst
For i = 1 To rstEmployee.RecordCount
lstEmployee.ListItems.Add , "_" & rstEmployee.Fields("Card"), rstEmployee.Fields("name")
lstEmployee.ListItems(i).Tag = rstEmployee.Fields("Card")
rstEmployee.MoveNext
Next
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -