⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmm1blk.frm

📁 一个完整的非接触IC卡会员管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmM1Blk 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "黑名单卡操作"
   ClientHeight    =   7035
   ClientLeft      =   15
   ClientTop       =   405
   ClientWidth     =   10875
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7035
   ScaleWidth      =   10875
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox f_bh 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   1680
      MaxLength       =   8
      TabIndex        =   6
      Top             =   720
      Width           =   2295
   End
   Begin VB.CommandButton Command3 
      Caption         =   "解除挂失(&W)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   6840
      TabIndex        =   5
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出(&Q)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   8640
      TabIndex        =   3
      Top             =   240
      Width           =   1695
   End
   Begin VB.CommandButton Command2 
      Caption         =   "挂失登记(&B)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   5040
      TabIndex        =   2
      Top             =   240
      Width           =   1695
   End
   Begin VB.TextBox txtCardNo 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   1680
      MaxLength       =   8
      TabIndex        =   0
      Top             =   240
      Width           =   2295
   End
   Begin MSComctlLib.ListView ListViewEmp 
      Height          =   5535
      Left            =   240
      TabIndex        =   4
      Top             =   1320
      Width           =   10335
      _ExtentX        =   18230
      _ExtentY        =   9763
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   0
   End
   Begin VB.Label Label10 
      Caption         =   "人员姓名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   7
      Top             =   720
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "IC卡号:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   270
      Left            =   360
      TabIndex        =   1
      Top             =   270
      Width           =   1815
   End
End
Attribute VB_Name = "frmM1Blk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim pscard As New ADODB.Recordset '本地临时库
Dim rs As New ADODB.Recordset
Dim pssql As String
Dim M1Key As String
Dim data32 As String * 32
Dim DataBuff32 As String * 32
Dim txtMoney As Currency
Dim pbOut(3) As Byte
Dim CardID As String
 
Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click() '登记挂失
On err GoTo err
If txtCardNo <> "" Then
    sWhere = ""
    sWhere = sWhere & IIf(Len(Trim(txtCardNo.Text)) = 0, "", " IC卡号= '" & Format(txtCardNo.Text, "00000000") & "' and ")
    sWhere = sWhere & IIf(Len(Trim(f_bh.Text)) = 0, "", " 人员编号= '" & f_bh & "' and ")
    
    If Len(Trim(sWhere)) > 0 Then
       sWhere = Left(sWhere, Len(sWhere) - 4)
       sWhere = " where " & sWhere
    End If
    sWhere = " select *  from 充值积分明细表" & sWhere & " order by 操作时间 desc"
    Set rs = GetRecordset(maSys_db, sWhere)
    
    If Not (rs.EOF And rs.BOF) Then
'        maSys_db.Execute "insert into 黑名单(IC卡号,状态,操作时间,操作员)" _
              & "values('" & Format(txtCardNo, "00000000") & "','挂失','" & Format(Now, "yyyy-mm-dd hh:mm:ss") & "','" & strUserName & "')"
        maSys_db.Execute "insert into 黑名单(IC卡号,状态,操作时间,操作员)" _
              & "values('" & Format(txtCardNo, "00000000") & "','挂失','" & Format(Now, "yyyy-mm-dd hh:mm:ss") & "','" & rs!员工编号 & "')"
        MsgBox "卡号为" & Trim(txtCardNo) & "的IC卡挂失成功!", vbInformation + vbOKOnly, "中芯德立提示"
        listrecord
    Else
        MsgBox "该卡号在数据库中不存在,请检查!", vbInformation + vbOKOnly, "中芯德立提示"
    End If
Else '
    MsgBox "输入不能为空,请输入...", vbInformation + vbOKOnly, "中芯德立提示"
    txtCardNo.SetFocus
End If
Exit Sub

err:
Exit Sub
End Sub

Private Sub Command3_Click()
Dim sCardid As Long
Dim sCardTYpe As Integer
Dim sDate As String
Dim sBalance As Currency
Dim sMonth As String

On err GoTo err1
If txtCardNo <> "" Or f_bh.Text <> "" Then
    sWhere = ""
    sWhere = sWhere & IIf(Len(Trim(txtCardNo.Text)) = 0, "", " IC卡号= '" & Format(txtCardNo.Text, "00000000") & "' and ")
    sWhere = sWhere & IIf(Len(Trim(f_bh.Text)) = 0, "", " 操作员= '" & f_bh & "' and ")
    
    If Len(Trim(sWhere)) > 0 Then
       sWhere = Left(sWhere, Len(sWhere) - 4)
       sWhere = " where " & sWhere
    End If
    Set rs = GetRecordset(maSys_db, " select *  from 黑名单" & sWhere)
    If Not (rs.EOF And rs.BOF) Then
        
        If MsgBox("需要连同IC卡一起解除挂失吗,请确认?", vbInformation + vbYesNo, "中芯德立提示信息") = vbYes Then
            
            If ReaderOpen = False Then MsgBox "未检测到IC卡读写器,请检查!", vbInformation + vbOKOnly, "中芯德立提示信息": Exit Sub
            If sKey = "" Then
                MsgBox "请先将密码卡放在感应区!", vbInformation + vbOKOnly, "中芯德立提示信息"
                If R_CardKey(sKey, sErr) = False Then MsgBox "密码装载失败!", vbInformation + vbOKOnly, "中芯德立提示信息": GoTo err
                sKey = Mid(sErr, 1, 8) & Mid(sErr, 17, 8)
                MsgBox "OK,请保管好密码卡,将用户卡放在读写器感应区!", vbInformation + vbOKOnly, "中芯德立提示信息"
            End If
            If R_Cardcheck(sKey, sCardid, sCardTYpe, sBalance, sDate, sMonth, sErr) = False And sErr = "ERR 1014" Then
                If R_ClearBlk() = False Then GoTo err
            End If
            Call ReaderClose
        End If
        
        maSys_db.Execute "delete  from 黑名单" & sWhere, dbFailOnError
        MsgBox "卡号" & Trim(txtCardNo) & "成功解除挂失!", vbInformation + vbOKOnly, "中芯德立提示"
        listrecord
    Else
        MsgBox "该卡号在数据库中不存在,请检查!", vbInformation + vbOKOnly, "中芯德立提示"
    End If
Else '
    MsgBox "输入不能为空,请输入...", vbInformation + vbOKOnly, "中芯德立提示"
    txtCardNo.SetFocus
End If
Exit Sub

err:
Call ReaderClose
Exit Sub

err1:
Exit Sub
End Sub

Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
'sWhere = "select * from 黑名单  order by 状态,IC卡号"
listrecord
End Sub

Private Sub listrecord()
Dim L As ListItem
Dim i As Integer

Set rs = GetRecordset(maSys_db, "select * from 黑名单  order by 状态,IC卡号")

ListViewEmp.ColumnHeaders.Clear
ListViewEmp.ListItems.Clear
ListViewEmp.View = lvwReport
ListViewEmp.ColumnHeaders.Add , , "ID", 800
ListViewEmp.ColumnHeaders.Add , , "IC卡号", 1500
ListViewEmp.ColumnHeaders.Add , , "状态", 1500
ListViewEmp.ColumnHeaders.Add , , "操作时间", 2500
ListViewEmp.ColumnHeaders.Add , , "人员姓名", 1500
i = 1
If rs.EOF Then
   Exit Sub
Else
    rs.MoveFirst
    Do While Not rs.EOF
        Set L = ListViewEmp.ListItems.Add(, , i)
            L.SubItems(1) = CStr(rs!IC卡号)
            L.SubItems(2) = CStr(rs!状态)
            L.SubItems(3) = CStr(rs!操作时间)
            L.SubItems(4) = CStr(rs!操作员)
'                L.SubItems(11) = CStr(rs!职务)
        i = i + 1
        rs.MoveNext
    Loop
End If
End Sub

Private Sub txtcardno_KeyPress(KeyAscii As Integer)
If KeyAscii > 57 Or KeyAscii < 48 And KeyAscii <> 8 Then
        KeyAscii = 0
End If
End Sub

Private Sub txtCardNo_LostFocus()
txtCardNo = Format(txtCardNo, "00000000")
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -