コード例 #1
0
        /*Single SMS CRUD Operation*/
        public bool singleSMSSend(string mobileNo, string messg, int smsTitleId)
        {
            bool status = true;


            if (mobileSMS.checkGSMConected())
            {
                cmd = new SqlCommand("SMSSentboxSp");
                cmd.Parameters.AddWithValue("@Action", "INSERT");
                cmd.Parameters.AddWithValue("@MobileNo", mobileNo);
                cmd.Parameters.AddWithValue("@MessgId", smsTitleId);
                cmd.Parameters.AddWithValue("@Date", DateTime.Now.ToString());

                if (mobileSMS.sendSMS(mobileNo, messg))
                {
                    status = true;
                    cmd.Parameters.AddWithValue("@Status", "sent");
                }
                else
                {
                    status = false;
                    cmd.Parameters.AddWithValue("@Status", "unsent");
                }

                adp.insert(cmd);
            }
            else
            {
                status = false;
            }

            return(status);
        }
コード例 #2
0
        /*Single SMS CRUD Operation*/
        public string singleSMSSend(string mobileNo, string messg)
        {
            string status = "";

            if (mobileSMS.checkGSMConected())
            {
                if (mobileSMS.sendSMS(mobileNo, messg))
                {
                    status = "M E S S A G E - S E N T Send Successfully!";
                }
                else
                {
                    status = "SMS No Send!";
                }
            }
            else
            {
                status = "GSM Device Not Connected!";
            }

            return(status);
        }