ClearGLog

Definition

Usage

Clear all attendance records from the device.

Parameter

Device number

Return Value

Return True if it is successful, or return False.

Related Function

ClearSLog, ClearKeeperData

 

Ejemplo

C#

private static void ClearGLog(string sIp = "10.0.0.44", int iPort = 4370)
{
    //Create Standalone SDK class dynamicly.
    zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
    int iMachineNumber = 1;
    axCZKEM1.Connect_Net(sIp, iPort);

    int idwErrorCode = 0;

    axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device
    if (axCZKEM1.ClearGLog(iMachineNumber))
    {
        axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be refreshed
        MessageBox.Show("All att Logs have been cleared from teiminal!", "Success");
    }
    else
    {
        axCZKEM1.GetLastError(ref idwErrorCode);
        MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
    }
    axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
}

VB

Private Shared Sub ClearGLog(Optional ByVal sIp As String = "10.0.0.44", Optional ByVal iPort As Integer = 4370)
    'Create Standalone SDK class dynamicly.
    Dim axCZKEM1 As New zkemkeeper.CZKEM
    Dim iMachineNumber As Integer

    axCZKEM1.Connect_Net(sIp, iPort)

    Dim idwErrorCode As Integer

    axCZKEM1.EnableDevice(iMachineNumber, False) 'disable the device
    If axCZKEM1.ClearGLog(iMachineNumber) = True Then
        axCZKEM1.RefreshData(iMachineNumber) 'the data in the device should be refreshed
        MsgBox("All att Logs have been cleared from teiminal!", MsgBoxStyle.Information, "Success")
    Else
        axCZKEM1.GetLastError(idwErrorCode)
        MsgBox("Operation failed,ErrorCode=" & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
    End If

    axCZKEM1.EnableDevice(iMachineNumber, True) 'enable the device
End Sub