public int sta_SetUserSMS(List <string> lblOutputInfo, int txtSMSID, long cbUserID) { if (GetConnectState() == false) { lblOutputInfo.Add("*Please connect first!"); return(-1024); } int idwErrorCode = 0; int iSMSID = txtSMSID; int iTag = 0; int iValidMins = 0; string sStartTime = ""; string sContent = ""; string sEnrollNumber = cbUserID.ToString(); axCZKEM1.EnableDevice(iMachineNumber, false); if (axCZKEM1.GetSMS(iMachineNumber, iSMSID, ref iTag, ref iValidMins, ref sStartTime, ref sContent) == false) { lblOutputInfo.Add("*The SMSID doesn't exist!!"); axCZKEM1.EnableDevice(iMachineNumber, true); return(-1022); } if (iTag != 254) { lblOutputInfo.Add("*The SMS does not Personal SMS,please set it as Personal SMS first!!"); axCZKEM1.EnableDevice(iMachineNumber, true); return(-1022); } if (axCZKEM1.SSR_SetUserSMS(iMachineNumber, sEnrollNumber, iSMSID)) { axCZKEM1.RefreshData(iMachineNumber);//After you have set user short message,you should refresh the data of the device lblOutputInfo.Add("Successfully set user SMS! "); } else { axCZKEM1.GetLastError(ref idwErrorCode); lblOutputInfo.Add("*Operation failed,ErrorCode=" + idwErrorCode.ToString()); } axCZKEM1.EnableDevice(iMachineNumber, true); return(idwErrorCode != 0 ? idwErrorCode : 1); }
private void button8_Click(object sender, EventArgs e) { axCZKEM1.SetSMS(1, 2, 254, 10, "2019-02-12 14:44:00", "Your Membership expires next month."); axCZKEM1.SSR_SetUserSMS(1, "6", 2); }