VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmLogData 
   Caption         =   "Log Data"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   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     =   3090
   ScaleWidth      =   4680
   WindowState     =   2  'Maximized
   Begin MSComctlLib.ListView listLog 
      Height          =   2055
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   4455
      _ExtentX        =   7858
      _ExtentY        =   3625
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   0   'False
      HideSelection   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   3
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "ID"
         Object.Width           =   2540
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "EnrollNumber"
         Object.Width           =   5080
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "DateTime"
         Object.Width           =   9994
      EndProperty
   End
   Begin VB.CommandButton CmdDelLog 
      Caption         =   "Del Log Data"
      Height          =   615
      Left            =   2760
      TabIndex        =   1
      Top             =   2280
      Width           =   1815
   End
   Begin VB.CommandButton CmdGetLog 
      Caption         =   "Get Log Data"
      Height          =   615
      Left            =   120
      TabIndex        =   0
      Top             =   2280
      Width           =   1815
   End
End
Attribute VB_Name = "FrmLogData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdDelLog_Click()
    Dim bRet As Boolean
    bRet = MDIFrm.BFLex1.DeleteGLogData(MdlVar.DeviceNumber, 0)
    If Not bRet Then
        MsgBox "DeleteGLogData", vbOKOnly, "Error"
    End If
End Sub

Private Sub CmdGetLog_Click()
    Dim i As Long, LogDate As Date, bRet As Boolean
    Dim lEnrollNumber As Long, lt As ListItem
    Dim id As Long
    Dim Glogs As Long
    
    listLog.ListItems.Clear
    id = 1
    Do
        Glogs = MDIFrm.BFLex1.ReadAllGLogData(MdlVar.DeviceNumber, id)
        If (Glogs <= 0) Then
            Exit Do
        End If
        For i = id To Glogs + id - 1
           bRet = MDIFrm.BFLex1.GetGeneralLogData(CLng(txtMachineNo), i, lEnrollNumber, LogDate)
           If Not bRet Then
                Exit For
           End If
           Set lt = listLog.ListItems.Add(, , CStr(i))
           lt.SubItems(1) = CStr(lEnrollNumber)
           lt.SubItems(2) = Format(LogDate, "YYYY-MM-dd hh:mm:ss")
        Next i
        id = id + Glogs
    Loop While (Glogs = 25)
    
End Sub

Private Sub Form_Resize()
    If Me.Width - 4800 + 4455 > 0 Then
        listLog.Width = Me.Width - 4800 + 4455
        CmdDelLog.Left = listLog.Width + listLog.Left - CmdDelLog.Width
      
    End If
    If Me.Height - 3600 + 1950 > 0 Then
        listLog.Height = Me.Height - 1500
        CmdGetLog.Top = listLog.Height + 240
        CmdDelLog.Top = CmdGetLog.Top
    End If
End Sub
