Set the customized attendance state value according to the original 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 (see descriptions of
EnableCustomizeAttState).
Device number
Original state value
New state value to be set
Return True if it is successful, or return False.
EnableCustomizeAttState, DelCustomizeAttState
/// <summary> /// Set the customized attendance state value according to the original attendance state value. Note: This /// function is a customized function. To use this function, the device must enable /// theexpansionfunctionandsupportcustomizedattendancestatevalues(seedescriptions of EnableCustomizeAttState). /// </summary> /// <param name="StateID">Original state value </param> /// <param name="NewStatel">Newstate value to be set</param> /// <param name="IP"> Ip of device </param> /// <param name="Port"> Port of Device </param> /// <param name="MachineNumber"> Device Number </param> private void SetCustomizeAttState(int StateID, int NewStatel, 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.SetCustomizeAttState(MachineNumber, StateID, NewStatel)) { MessageBox.Show("SetCustomizeAttState! ", "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } }
''' <summary> ''' Set the customized attendance state value according to the original attendance state value. Note: This ''' function is a customized function. To use this function, the device must enable ''' theexpansionfunctionandsupportcustomizedattendancestatevalues(seedescriptions of EnableCustomizeAttState). ''' </summary> ''' <param name="StateID">Original state value </param> ''' <param name="NewStatel">Newstate value to be set</param> ''' <param name="IP"> Ip of device </param> ''' <param name="Port"> Port of Device </param> ''' <param name="MachineNumber"> Device Number </param> Private Sub SetCustomizeAttState(ByVal StateID As Integer, ByVal NewStatel 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.SetCustomizeAttState(MachineNumber, StateID, NewStatel) Then MessageBox.Show("SetCustomizeAttState! ", "Success") Else axCZKEM1.GetLastError(idwErrorCode) MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error") End If End Sub