SSR_GetHoliday

Definition

Usage

Obtain holiday settings on the device by holiday ID.

Parameter

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

SSR_SetHoliday

 

Ejemplo

C#

        /// <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 void SSR_GetHoliday(int iHolidayID, 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;
        int iTZID = 0;  //the timezone of the holiday using
        int iBM = 0;    //begining month
        int iBD = 0;    //begining day
        int iEM = 0;    //ending month
        int iED = 0;    //ending day
        if (axCZKEM1.SSR_GetHoliday(MachineNumber, iHolidayID, ref iBM, ref iBD, ref iEM, ref iED, ref iTZID))
            {
                MessageBox.Show("Holiday: begining month: " + iBM + "begining day: " + iBD + "ending month: " + iEM + "ending month: " + iEM, "Success");
            }
        else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

        ''' <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 Sub SetHoliday(iHolidayID As Integer, iTZID As Integer, iBM As Integer, iBD As Integer, iEM As Integer, iED As Integer, 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.SSR_SetHoliday(MachineNumber, iHolidayID, iBM, iBD, iEM, iED, iTZID) = True Then
            axCZKEM1.RefreshData(MachineNumber) 'the data in the device should be refreshed
            MsgBox("SSR_SetHoliday!", MsgBoxStyle.Information, "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
        End Sub