private void SendSMS(string UserRole) { dbUser dbUserData = new dbUser(); CommonFunction fnCommon = new CommonFunction(); DataSet dsUserTypeData = new DataSet(); //Get User Mobile based on Role dsUserTypeData = dbUserData.GetUserBasedOnRole(UserRole); if (dsUserTypeData.Tables[0].Rows.Count > 0) { foreach (DataRow rows in dsUserTypeData.Tables[0].Rows) { string UserMobileNo = rows["mobile1"].ToString(); if (string.IsNullOrEmpty(UserMobileNo)) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Mobile Number Not available, Please contact administrator');", true); // Response.Redirect("~/UserLogin.aspx"); } else { string MobileMessage = "Document is sent to you for approval "; fnCommon.sendsms("+91" + UserMobileNo, MobileMessage); } } //} } }
private void SendSMS(string UserRole) { dbUser dbUserData = new dbUser(); CommonFunction fnCommon = new CommonFunction(); DataSet dsUserTypeData = new DataSet(); //Get User Mobile based on Role dsUserTypeData = dbUserData.GetUserBasedOnRole(UserRole); if (dsUserTypeData.Tables[0].Rows.Count > 0) { foreach (DataRow rows in dsUserTypeData.Tables[0].Rows) { string UserMobileNo = rows["mobile1"].ToString(); if (string.IsNullOrEmpty(UserMobileNo)) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Mobile Number Not available, Please contact administrator');", true); // Response.Redirect("~/UserLogin.aspx"); } else { string FromName = "Solicitor"; string DocNo = LblDocNo.Text; //string MobileMessage = "Document is sent to you for approval "; //Document No. %%| DocNo ^{ "inputtype" : "text", "maxlength" : "20"}%% sent you from %%| FromName ^{ "inputtype" : "text", "maxlength" : "20"}%% string MobileMessage = "Document No. " + DocNo + " sent you from " + FromName; fnCommon.sendsms("+91" + UserMobileNo, MobileMessage); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('SMS Send to Head Office');", true); } } //} } }
private void SendSMS(string UserRole) { dbUser dbUserData = new dbUser(); CommonFunction fnCommon = new CommonFunction(); DataSet dsUserTypeData = new DataSet(); //Get User Mobile based on Role dsUserTypeData = dbUserData.GetUserBasedOnRole(UserRole); if (dsUserTypeData.Tables[0].Rows.Count > 0) { foreach (DataRow rows in dsUserTypeData.Tables[0].Rows) { string UserMobileNo = rows["mobile1"].ToString(); if (string.IsNullOrEmpty(UserMobileNo)) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Mobile Number Not available, Please contact administrator');", true); // Response.Redirect("~/UserLogin.aspx"); } else { string MobileMessage = "Document is sent to you for approval "; fnCommon.sendsms("+91" + UserMobileNo, MobileMessage); } } } //dbUserData.UserName = Session["UserName"].ToString(); //string MobileNo = dbUserData.GetMobileNo(); //String message = HttpUtility.UrlEncode("This is test Message from -- SEZTHANE"); //using (var wb = new WebClient()) //{ // byte[] response = wb.UploadValues("https://api.textlocal.in/send/", new NameValueCollection() // { // {"apikey" , "MK7fugiPrhQ-7bOiwEjRcBqziqL2eH9r6QITPtS2K6"}, // //{"numbers" , "919890037859"}, // {"numbers" , "919890037859"}, // {"message" , message}, // {"sender" , "SEZTHA"} // }); // string result = System.Text.Encoding.UTF8.GetString(response); // //return result; //} }