VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmEnrollData 
   Caption         =   "Enroll Data"
   ClientHeight    =   6435
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   12075
   BeginProperty Font 
      Name            =   "Times New Roman"
      Size            =   14.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   6435
   ScaleWidth      =   12075
   Begin VB.CommandButton cmdDeleteAllEnrollData 
      Caption         =   "Delete All Enroll Data"
      Height          =   615
      Left            =   4200
      TabIndex        =   17
      Top             =   5520
      Width           =   2655
   End
   Begin VB.TextBox txtBinding 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   8760
      TabIndex        =   15
      Top             =   1560
      Width           =   2295
   End
   Begin VB.CommandButton CmdGetUserID 
      Caption         =   "Get User ID"
      Height          =   615
      Left            =   120
      TabIndex        =   13
      Top             =   5520
      Width           =   1575
   End
   Begin VB.CommandButton CmdGetEnrollData 
      Caption         =   "Get Enroll Data"
      Height          =   615
      Left            =   6960
      TabIndex        =   12
      Top             =   5520
      Width           =   2055
   End
   Begin VB.CommandButton CmdSetEnrollData 
      Caption         =   "Set Enroll Data"
      Height          =   615
      Left            =   9120
      TabIndex        =   11
      Top             =   5520
      Width           =   1935
   End
   Begin VB.CommandButton CmdDeleteEnrollData 
      Caption         =   "Delete Enroll Data"
      Height          =   615
      Left            =   1800
      TabIndex        =   10
      Top             =   5520
      Width           =   2295
   End
   Begin VB.TextBox TxtEnrollData 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2655
      Left            =   6480
      MultiLine       =   -1  'True
      TabIndex        =   9
      Top             =   2760
      Width           =   4575
   End
   Begin VB.TextBox txtEnrollNumber 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   8760
      TabIndex        =   3
      Top             =   120
      Width           =   2295
   End
   Begin VB.TextBox txtBackupNumber 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   8760
      TabIndex        =   2
      Top             =   600
      Width           =   2295
   End
   Begin VB.TextBox txtMachinePrivilege 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   8760
      TabIndex        =   1
      Top             =   1080
      Width           =   2295
   End
   Begin VB.TextBox txtPassword 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   8760
      TabIndex        =   0
      Top             =   2040
      Width           =   2295
   End
   Begin MSComctlLib.ListView ListUser 
      Height          =   5295
      Left            =   120
      TabIndex        =   14
      Top             =   120
      Width           =   5895
      _ExtentX        =   10398
      _ExtentY        =   9340
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   0   'False
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   4
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "EnrollNumber"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "BackupNumber"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "MachinePrivilege"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "Binding"
         Object.Width           =   2540
      EndProperty
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      Caption         =   "Binding:"
      Height          =   375
      Left            =   6480
      TabIndex        =   16
      Top             =   1560
      Width           =   2175
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "EnrollNumber:"
      Height          =   255
      Left            =   6480
      TabIndex        =   8
      Top             =   120
      Width           =   2175
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "BackupNumber:"
      Height          =   255
      Left            =   6480
      TabIndex        =   7
      Top             =   600
      Width           =   2175
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      Caption         =   "MachinePrivilege:"
      Height          =   375
      Left            =   6480
      TabIndex        =   6
      Top             =   1080
      Width           =   2175
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      Caption         =   "Password:"
      Height          =   255
      Left            =   6480
      TabIndex        =   5
      Top             =   2040
      Width           =   2175
   End
   Begin VB.Label Label5 
      Caption         =   "EnrollData:"
      Height          =   255
      Left            =   6480
      TabIndex        =   4
      Top             =   2400
      Width           =   2175
   End
End
Attribute VB_Name = "FrmEnrollData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDeleteAllEnrollData_Click()
    
    If Not MDIFrm.BFLex1.DeleteAllEnrollData(MdlVar.DeviceNumber) Then
        MsgBox "Delete all enroll data error"
    Else
        ListUser.ListItems.Clear
    End If
    
End Sub

Private Sub CmdDeleteEnrollData_Click()
   If Not MDIFrm.BFLex1.DeleteEnrollData(MdlVar.DeviceNumber, CLng(txtEnrollNumber), CLng(txtBackupNumber)) Then
        MsgBox "Delete enroll data error"
   End If
End Sub

Private Sub CmdGetEnrollData_Click()
   Dim bRet As Boolean, Privilege As Long, Binding As Long
    Dim password As String, FingerData As String
    Dim str As String
    
    bRet = MDIFrm.BFLex1.GetEnrollData(MdlVar.DeviceNumber, CLng(txtEnrollNumber), CLng(txtBackupNumber), Privilege, Binding, FingerData, password)
    If Not bRet Then
        MsgBox "Get enroll data error"
        Exit Sub
    End If
    txtMachinePrivilege.Text = CStr(Privilege)
    txtBinding.Text = CStr(Binding)
    If CLng(txtBackupNumber) = 0 Then
        txtPassword.Text = password
    Else
        txtPassword.Text = ""
        TxtEnrollData.Text = FingerData
    End If
End Sub

Private Sub CmdGetUserID_Click()
    Dim bRet As Boolean
    Dim i As Long
    Dim EnrollNumber As Long, MachinePrivilege As Long, Binding As Long, backup As Long
    
    Users = MDIFrm.BFLex1.ReadAllUserID(MdlVar.DeviceNumber)
    If Users < 0 Then
        MsgBox "Read All User ID Error", vbOKOnly, "Error"
        Exit Sub
    End If
    ListUser.ListItems.Clear
    For i = 0 To Users - 1
    
        bRet = MDIFrm.BFLex1.GetAllUserID(i, EnrollNumber, MachinePrivilege, backup, Binding)
        
        If Not bRet Then
            Exit For
        End If
        
       Set lt = ListUser.ListItems.Add(, , CStr(EnrollNumber))
       lt.SubItems(1) = CStr(backup)
       lt.SubItems(2) = CStr(MachinePrivilege)
       lt.SubItems(3) = CStr(Binding)
    Next i
End Sub

Private Sub CmdSetEnrollData_Click()
    bRet = MDIFrm.BFLex1.SetEnrollData(MdlVar.DeviceNumber, CLng(txtEnrollNumber), CLng(txtBackupNumber), CLng(txtMachinePrivilege), CLng(txtBinding), TxtEnrollData.Text, txtPassword)
    
    If Not bRet Then
        MsgBox "Set Enroll Data error", vbOKOnly, "Error"
    End If
End Sub

Private Sub ListUser_ItemClick(ByVal Item As MSComctlLib.ListItem)
    txtEnrollNumber = Item.Text
    txtBackupNumber = Item.SubItems(1)
End Sub
