SetUserTZs

Definition

Usage

Set the time slot of a user. A maximum of three time slots can be set for each user. The difference between this function and SetUserTZStr is the format of imported time slot index.

Parameter

Device number

User ID

Time zone ID. If the value of TZs[3] is 0, use the time zone setting of the time zone group. If the value of TZs[3] is 1, designate one user's time zone setting. The TZs parameter is a long pointer. Three time zone IDs can be imported through TZs[0], TZs[1], and TZs[2].

Return Value

Return True if it is successful, or return False.

Related Function

GetUserTZs, GetUserTZStr

 

Ejemplo

C#

private static int setUserTZs(string ipAddr, int port, int userId, int tZ)
        {
int idwErrorCode = 0;
            
//Create Standalone SDK class dynamicly.
            zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
if (axCZKEM1.Connect_Net(ipAddr, 4370))
            {
int iMachineNumber = 1;
if (axCZKEM1.SetUserTZs(iMachineNumber, userId, ref tZ))
                {
                    MessageBox.Show("Operation Success! Read File from device: " + ipAddr);
                }
else
                {
                    axCZKEM1.GetLastError(ref idwErrorCode);
                    MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
                }
            }
else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
            }
return idwErrorCode;
        }
    }

VB

Private Sub setUserTZs(ipAddr As String, port As Int32, userID As Int32, ByRef tZ As Int32)
'Create Standalone SDK class dynamicly.
Dim axCZKEM1 As New zkemkeeper.CZKEM
Dim iMachineNumber As Integer
Dim idwErrorCode As Integer
If axCZKEM1.Connect_Net(ipAddr, port) = True Then
Dim iDelay As Integer = 4 'time to delay
If axCZKEM1.SetUserTZs(iMachineNumber, userID, tZ) = True Then
                MsgBox("Operation Success! Data Read from device: " + ipAddr)
Else
                axCZKEM1.GetLastError(idwErrorCode)
                MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
End If
Else
            axCZKEM1.GetLastError(idwErrorCode)
End If
End Sub