DeleteUserSMS

Definition

Usage

Delete the specified short message of a specified user. In this case, only the mapping between the user and short message, instead of the short message, is deleted.

Parameter

Device number

User ID

Short message number

Return Value

Return True if it is successful, or return False.

Related Function

SetUserSMS

 

Ejemplo

C#

        /// <summary>
        /// Delete relativity between the appoited user and the short message relating with the user.
        /// You should input the user's id and the short message id relating with the user.
        /// </summary>
        /// <param name="SMSID">Short message number</param>
        /// <param name="EnrollNumber">User ID</param>
        /// <param name="IP"> Ip of device </param>
        /// <param name="Port"> Port of Device </param>
        /// <param name="MachineNumber"> Device Number </param>
        private void DeleteUserSMS(int SMSID, int EnrollNumber, 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.DeleteUserSMS(MachineNumber, EnrollNumber, SMSID))//modify by Darcy on Nov.23 2009
            {
                axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed
                MessageBox.Show("Successfully Delete user SMS! ", "Success");
            }
        else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

        ''' <summary>
        ''' Delete relativity between the appoited user And the short message relating with the user.
        ''' You should input the user's id and the short message id relating with the user.
        ''' </summary>
        ''' <param name="SMSID">Short message number</param>
        ''' <param name="EnrollNumber">User ID</param>
        ''' <param name="IP"> Ip of device </param>
        ''' <param name="Port"> Port of Device </param>
        ''' <param name="MachineNumber"> Device Number </param>
        Private Sub DeleteUserSMS(SMSID As Integer, EnrollNumber 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_DeleteUserSMS(MachineNumber, EnrollNumber, SMSID) = True Then
            axCZKEM1.RefreshData(MachineNumber) 'After you have delete the short message,you should refresh the data of the device
            MsgBox("Successfully Delete user SMS!", MsgBoxStyle.Information, "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
        End Sub