Enable the customized attendance state value. Note: This function is a customized function.
To use this function, the device must enable the expansion function and support customized attendance state values.
Customized attendance state value: The mappings between attendance state values and
states of the current device are as follows: If this function is enabled, the value of a specific
state can be changed by using SetCustomizeAttState. 0—Check-In 1—Check-Out 2—Break-Out 3—Break-In 4—OT-In 5—OT-Out
For example, EnableCustomizeAttState (1, 0, 1)//Enable the customized state of value 0 (that is, check-in).
EnableCustomizeAttState (1, 0, 8)//Set the customized state of value 0 (that is, check-in) to 8.
After the user selects check-in on the device and passes verification, the saved attendance record state value is 8.
Device number
Attendance state value to be customized
Whether the customized attendance state is used for the state described by StateID
Return True if it is successful, or return False.
SetCustomizeAttState, DelCustomizeAttState
/// <summary> /// Enable the customized attendance state value. Note:This function is a customized function. To use this function, the /// device must enable the expansion functionand support customized attendance state values. Customized attendance state /// value: The mappings between attendance state values and states of the current device are as follows: If this function /// is enabled, the value of a specific state can be changed by using SetCustomizeAttState. 0—Check-In 1—Check-Out /// 2—Break-Out 3—Break-In 4—OT-In 5—OT-Out For example, EnableCustomizeAttState (1, 0, 1)//Enable the customized state /// of value 0 (that is, check-in). EnableCustomizeAttState (1, 0, 8)//Set the customized state of value 0 (that is, check-in) /// to 8. After the user selects check-in on the device and passes verification, the saved attendance record state value is 8. /// </summary> /// <param name="StateID">Attendance state value to be customized </param> /// <param name="Enable">Whether the customized attendance state is used for the state described by StateID</param> /// <param name="IP"> Ip of device </param> /// <param name="Port"> Port of Device </param> /// <param name="MachineNumber"> Device Number </param> private void EnableCustomizeAttState(int StateID, int Enable, string IP = "10.0.0.44", int Port = 4370, int MachineNumber = 1) { //Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); axCZKEM1.Connect_Net(IP, Port); int idwErrorCode = 0; if (axCZKEM1.EnableCustomizeAttState(MachineNumber, StateID, Enable)) { MessageBox.Show("EnableCustomizeAttState! ", "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } }
''' <summary> ''' Enable the customized attendance state value. Note:This function is a customized function. To use this function, the ''' device must enable the expansion functionand support customized attendance state values. Customized attendance state ''' value: The mappings between attendance state values and states of the current device are as follows: If this function ''' is enabled, the value of a specific state can be changed by using SetCustomizeAttState. 0—Check-In 1—Check-Out ''' 2—Break-Out 3—Break-In 4—OT-In 5—OT-Out For example, EnableCustomizeAttState (1, 0, 1)//Enable the customized state ''' of value 0 (that is, check-in). EnableCustomizeAttState (1, 0, 8)//Set the customized state of value 0 (that is, check-in) ''' to 8. After the user selects check-in on the device and passes verification, the saved attendance record state value is 8. ''' </summary> ''' <param name="StateID">Attendance state value to be customized </param> ''' <param name="Enable">Whether the customized attendance state is used for the state described by StateID</param> ''' <param name="IP"> Ip of device </param> ''' <param name="Port"> Port of Device </param> ''' <param name="MachineNumber"> Device Number </param> Private Sub EnableCustomizeAttState(ByVal StateID As Integer, ByVal Enable As Integer, Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1) 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As zkemkeeper.CZKEMClass = New zkemkeeper.CZKEMClass() axCZKEM1.Connect_Net(IP, Port) Dim idwErrorCode As Integer = 0 If axCZKEM1.EnableCustomizeAttState(MachineNumber, StateID, Enable) Then MessageBox.Show("EnableCustomizeAttState! ", "Success") Else axCZKEM1.GetLastError(idwErrorCode) MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error") End If End Sub