Set holidays.


Device number

Holiday ID

Start time of holidays

End time of holidays

Time slot ID of holidays

Return Value

Return True if it is successful, or return False.

Related Function





        /// <summary>
        /// Set the holiday.
        /// Please refer to development manual to look over detailed parameters.
        /// </summary>
        /// <param name="iHolidayID">Holiday ID</param>
        /// <param name="iTZID">the timezone of the holiday using</param>
        /// <param name="iBM">begin month</param>
        /// <param name="iBD">/begin day</param>
        /// <param name="iEM">end month</param>
        /// <param name="iED">end day</param>
        /// <param name="IP"> Ip of device </param>
        /// <param name="Port"> Port of Device </param>
        /// <param name="MachineNumber"> Device Number </param>
        private void SSR_SetHoliday(int iHolidayID, int iTZID, int iBM, int iBD, int iEM, int iED, string IP = "", 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.SSR_SetHoliday(MachineNumber, iHolidayID, iBM, iBD, iEM, iED, iTZID))
                axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed
                MessageBox.Show("SSR_SetHoliday! ", "Success");
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");


        ''' <summary>
        ''' Get the holiday according to its id.
        ''' </summary>
        ''' <param name="iHolidayID">Holiday ID</param>
        ''' <param name="IP"> Ip of device </param>
        ''' <param name="Port"> Port of Device </param>
        ''' <param name="MachineNumber"> Device Number </param>
        Private Sub GetHoliday(iHolidayID As Integer, Optional IP As String = "", 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))
        Dim iTZID As Integer
        Dim iBM As Integer 'begining month
        Dim iBD As Integer 'begining day
        Dim iEM As Integer 'ending month
        Dim iED As Integer 'ending day
        If axCZKEM1.SSR_GetHoliday(MachineNumber, iHolidayID, iBM, iBD, iEM, iED, iTZID) = True Then
            MsgBox("Holiday: begining month: " & iBM & "begining day: " & iBD & "ending month: " & iEM & "ending month: " & iEM, MsgBoxStyle.Information, "Success")
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
        End Sub