Select Case sValue
Case 5 'Older SDK
labStatus.Text = "Getting data from old clock " + vIP + " System Options = " + sValue + " Platform = " + sPlatform
labStatus.Refresh()
'Pause clock
CZKEM1.Beep(150)
CZKEM1.ClearLCD()
CZKEM1.EnableClock(0)
CZKEM1.WriteLCD(0, 0, " One moment")
CZKEM1.WriteLCD(1, 0, " please")
CZKEM1.WriteLCD(2, 0, " Punches are")
CZKEM1.WriteLCD(3, 0, " being uploaded")
While CZKEM1.GetGeneralExtLogData(vMachineNumber, dwEnrollNumber, dwVerifyMode, dwInOutMode, YYYY, MM, DD, HH, MN, SS, dwWorkCode, dwReserved)
i += 1
PunchDate = Strings.Right("0" & Trim(Str(MM)), 2) & "/" & Strings.Right("0" & Trim(Str(DD)), 2) & "/" & Trim(Str(YYYY))
PunchTime = Strings.Right("0" & Trim(Str(HH)), 2) & ":" & Strings.Right("0" & Trim(Str(MN)), 2)
timeStr = PunchDate & " " & PunchTime
dwWorkCode = dwWorkCode / 100
'dwWorkCode = 99999 '<============== debugging code
strSQL = "insert into CLOCKPUNCHES (BadgeID, ClockID, dwInOutMode, dwWorkCode, ClockPunchesDate, ClockPunchesTime, ClockPunchesIP, ClockPunchesUploadTime, ClockPunchesSession, ClockPunchesClientBatch, RunitID) " _
& "values('" & dwEnrollNumber & "'," & CLng(vMachineNumber) & "," _
& dwInOutMode & "," & dwWorkCode & ",'" & PunchDate & "','" & PunchTime & "','" & vIP & "','" & Now & "'," & vSessionBatch & "," & vClientBatch & "," & vRunit & ")"
'MsgBox(strSQL) '<============== debugging code
Dim sqlPunch As New System.Data.SqlClient.SqlCommand(strSQL, conPunch)
sqlPunch.ExecuteNonQuery()
End While
CZKEM1.EnableClock(1) 'Unpause clock
Case 9 'Newer SDK
'MsgBox("New clock")
labStatus.Text = "Getting data from NEW clock " + vIP + " System Options = " + sValue + " Platform = " + sPlatform
labStatus.Refresh()
'CZKEM1.PlayVoiceByIndex(6)
CZKEM1.EnableDevice(vMachineNumber, False) 'disable the device
If CZKEM1.ReadGeneralLogData(vMachineNumber) Then 'read all the attendance records to the memory
'get records from the memory
While CZKEM1.SSR_GetGeneralLogData(vMachineNumber, dwEnrollNumber, dwVerifyMode, dwInOutMode, YYYY, MM, DD, HH, MN, SS, dwWorkCode)
i += 1
PunchDate = Strings.Right("0" & Trim(Str(MM)), 2) & "/" & Strings.Right("0" & Trim(Str(DD)), 2) & "/" & Trim(Str(YYYY))
PunchTime = Strings.Right("0" & Trim(Str(HH)), 2) & ":" & Strings.Right("0" & Trim(Str(MN)), 2)
timeStr = PunchDate & " " & PunchTime
dwWorkCode = dwWorkCode / 100
'dwWorkCode = 99999 '<============== debugging code
strSQL = "insert into CLOCKPUNCHES (BadgeID, ClockID, dwInOutMode, dwWorkCode, ClockPunchesDate, ClockPunchesTime, ClockPunchesIP, ClockPunchesUploadTime, ClockPunchesSession, ClockPunchesClientBatch, RunitID) " _
& "values('" & dwEnrollNumber & "'," & CLng(vMachineNumber) & "," _
& dwInOutMode & "," & dwWorkCode & ",'" & PunchDate & "','" & PunchTime & "','" & vIP & "','" & Now & "'," & vSessionBatch & "," & vClientBatch & "," & vRunit & ")"
'MsgBox(strSQL) '<============== debugging code
Dim sqlPunch As New System.Data.SqlClient.SqlCommand(strSQL, conPunch)
sqlPunch.ExecuteNonQuery()
'If i = 3 Then Exit While '<============== debugging code
End While
End If
CZKEM1.EnableDevice(vMachineNumber, True) 'enable the device
End Select
Slice of VB to download internet based timeclocks.