Esempio n. 1
0
        protected void btnVerifyMobileNumber_Click(object sender, EventArgs e)
        {
            lblOTPError.Text = "";
            if (txtMobileNumber.Text != "")
            {
                if(txtMobileNumber.Text.Trim().Length == 10)
                {
                    if(System.Text.RegularExpressions.Regex.IsMatch(txtMobileNumber.Text.Trim(), @"^\d+$"))
                    {
                        AryaVysyaPortalSave AVPS = new AryaVysyaPortalSave();
                        if (AVPS.CheckMobileNumExist(txtMobileNumber.Text.Trim()))
                        {
                            txtOTP.Text = "";
                            txtOTP.Focus();

                            AVP.EncryptedOTP = Enc.Encrypt(otp.NewOTP());
                            string Message = Enc.Decrypt(AVP.EncryptedOTP) + " is your OTP to verify, your application number avp. do not share with others. From:KARNATAKA ARYA VYSYA COMMUNITY DEVELOPMENT CORPORATION";
                            SM.sendSMS(txtMobileNumber.Text.Trim(), Message, 2, "LGNOTP");
                            AVPMobileNumVerifyPopup.Show();
                        }
                        else 
                        {
                            lblNotificationHeading.Text = "Exist";
                            lblNotificationContent.Text = "Mobile Number already exist <br/ >Change Your Mobile Number";
                            txtMobileNumber.ReadOnly = false;
                            btnVerifyMobileNumber.Visible = true;
                            OtherDetailsPopup.Show();
                        }
                    }
                    else
                    {
                        lblNotificationHeading.Text = "Error";
                        lblNotificationContent.Text = "Enter Valid Mobile Number";
                        txtMobileNumber.Focus();
                        OtherDetailsPopup.Show();
                    }
                }
                else
                {
                    lblNotificationHeading.Text = "Error";
                    lblNotificationContent.Text = "Enter Valid Mobile Number";
                    OtherDetailsPopup.Show();
                    txtMobileNumber.Focus();
                }
            }
            else
            {
                lblNotificationHeading.Text = "Error";
                lblNotificationContent.Text = "Enter Mobile Number";
                txtMobileNumber.Focus();
                OtherDetailsPopup.Show();
            }
        }
Esempio n. 2
0
 public string SendMessage(string Message, string MobileNumber, string MessageType, string Key)
 {
     if (Key == "KABA94ASBHSU14DBA3U")
     {
         if (Message.Length > 1)
         {
             if (MobileNumber.Length == 10)
             {
                 if (System.Text.RegularExpressions.Regex.IsMatch(MobileNumber, @"^\d+$"))
                 {
                     SendSMS SM = new SendSMS();
                     return(SM.sendSMS(MobileNumber, Message, 2, MessageType));
                 }
                 else
                 {
                     return("Invalid Mobile Number");
                 }
             }
             else
             {
                 return("Invalid Mobile Number");
             }
         }
         else
         {
             return("Invalid Message");
         }
     }
     else
     {
         return("Invalid Key");
     }
 }
Esempio n. 3
0
        public string SendSMSCode(string site, string phone, string LoginACCOUNT)
        {
            try
            {
                string code    = createCode();
                string content = @"親愛的NewSafety夥伴您好: 您的簡訊驗證碼為" + code + ",請至網頁輸入驗證,謝謝!";

                string cellPhone = "";

                if (phone.Substring(0, 1) == "0")
                {
                    cellPhone = site + phone.Substring(1);
                }
                else
                {
                    cellPhone = site + phone;
                }

                if (!sendSMS.sendSMS("簡訊驗證碼", content, cellPhone, ""))
                {
                    return("");
                }

                log.writeLogToDB(LoginACCOUNT, "SMS/SendSMSCode", "報客戶,發送簡訊驗證碼" + code + "至" + cellPhone);

                return(code);
            }
            catch (Exception e)
            {
                log.writeLogToDB(LoginACCOUNT, "SMS/SendSMSCode", e.ToString());
                return("");
            }
        }
Esempio n. 4
0
        public void sendMsg(string cid, string msg)
        {
            CourseDB cdb       = new CourseDB();
            string   phoneNums = cdb.phoneNums(cid);

            sender.sendSMS(msg, phoneNums);
        }
Esempio n. 5
0
        public void ConsumeMessage([FromBody] StockRespons stock)
        {
            _stockServer.UpdateStock(stock);
            SendSMS send = new SendSMS();

            send.InitializeSMS();
            send.sendSMS("PATCHED", stock.Name.ToString(), stock.Price.ToString());
        }
Esempio n. 6
0
        public void ConsumeMessage([FromBody] StockRespons stock)
        {
            _stockServer.AddStock(stock);
            SendSMS send = new SendSMS();

            send.InitializeSMS();
            send.sendSMS("ADDED", stock.Name.ToString());
        }
Esempio n. 7
0
 protected void btnSendSingleMessage_Click(object sender, EventArgs e)
 {
     if (txtMobileNumber.Text.Trim() != "")
     {
         if (txtMobileNumber.Text.Trim().Length == 10)
         {
             if (Regex.IsMatch(txtMobileNumber.Text.Trim(), @"^\d+$"))
             {
                 string status = "";
                 if (txtMessage.Text.Trim() != "")
                 {
                     status = SSMS.sendSMS(txtMobileNumber.Text.Trim(), txtMessage.Text.Trim(), 2, "SINGLE");
                     if (status.StartsWith("402") || status == "Message Sent")
                     {
                         DisplayAlert("Message Sent", this);
                     }
                     else
                     {
                         DisplayAlert(status, this);
                     }
                 }
                 else
                 {
                     DisplayAlert("Enter Valid Message Number", this);
                 }
             }
             else
             {
                 DisplayAlert("Enter Valid Mobile Number", this);
             }
         }
         else
         {
             DisplayAlert("Enter Valid Mobile Number", this);
         }
     }
     else
     {
         DisplayAlert("Enter Mobile Number", this);
     }
 }
Esempio n. 8
0
        public void ApplicantSMSConfirmation(string MobileNumber, string ApplicationNumber, string LoanName, string ApplicantName)
        {
            string Message = "Dear Applicant, " + ApplicantName + " your " + LoanName + " loan application number " + ApplicationNumber + " is received. We will notify once processed. From:KARNATAKA ARYA VYSYA COMMUNITY DEVELOPMENT CORPORATION";

            MSG.sendSMS(MobileNumber, Message, 2, "ACKNOW");
        }