Set holidays.
Device number
Holiday to be set, in format of mmddmmdd. For example, 04140511 indicates that holidays start from April 14 to May 11.
Return True if it is successful, or return False.
GetHoliday, SSR_GetHoliday
/// <summary> /// Set the holiday according to the specified holiday format. /// Please refer to development manual to learn how to input the specified format holiday. /// </summary> /// <param name="Holiday">Holiday to be set, in format of mmddmmdd. For example, 04140511 indicates that holidays start from April 14 To May 11.</param> /// <param name="IP"> Ip of device </param> /// <param name="Port"> Port of Device </param> /// <param name="MachineNumber"> Device Number </param> private void SetHoliday(string Holiday, 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.SetHoliday(MachineNumber, Holiday)) { axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed MessageBox.Show("SetHoliday! ", "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } }
''' <summary> ''' Set the holiday according to the specified holiday format. ''' Please refer to development manual to learn how to input the specified format holiday. ''' </summary> ''' <param name="Holiday">Holiday to be set, in format of mmddmmdd. For example, 04140511 indicates that holidays start from April 14 To May 11.</param> ''' <param name="IP"> Ip of device </param> ''' <param name="Port"> Port of Device </param> ''' <param name="MachineNumber"> Device Number </param> Private Sub SetHoliday(Holiday As String, Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1) Dim idwErrorCode As Integer = 0 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM axCZKEM1.Connect_Net(IP, Convert.ToInt32(Port)) If axCZKEM1.SetHoliday(MachineNumber, Holiday) = True Then axCZKEM1.RefreshData(MachineNumber) 'the data in the device should be refreshed MsgBox("SetHoliday", MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If End Sub