private void SendVerificationMessage(string mobileNo, int verificationCode) { string sendMessage = "You have got a verification message from HSSMI. Verification code : " + verificationCode; SendSms sendSms = new SendSms(); sendSms.SendMessage(mobileNo, sendMessage); }
protected void btnSendCode_Click(object sender, EventArgs e) { TblAdmin obj = new TblAdmin(TblAdmin.Columns.Contact, txtContact.Text); if (ConfigurationManager.AppSettings["PinCode"] == txtPinCode.Text) { if (!String.IsNullOrEmpty(obj.Contact)) { obj.IsNew = false; obj.VerificationCode = helper.generateRandomCode(5); SendSms.SendMessage(txtContact.Text, "Your password reset code is " + obj.VerificationCode); obj.Save(); divReset.Visible = false; divPasswordUpdate.Visible = true; } else { lblmsg.ForeColor = Color.Red; lblmsg.Text = "Invalid account contact no!"; } } else { lblmsg.ForeColor = Color.Red; lblmsg.Text = "Invalid Pin code!"; } }
private void SendMessageToDoctor(string mobileNo, string password) { string sendMessage = "Congrates! Your HSSMI account has been created. Your Login ID : " + mobileNo + " and Your password : " + password; SendSms sendSms = new SendSms(); sendSms.SendMessage(mobileNo, sendMessage); }
private void SendCencelMessageToUser(string mobileNo, BookAppointment bookAppointment) { BookAppointment bookAppointInfo = aMainAdminManager.GetBookAppointInfo(bookAppointment); string sendMessage = "Sorry! Your Appointment Booking has been cenceled for " + bookAppointInfo.DoctorName + ". Appointment Date : " + bookAppointInfo.AppointDate + ", Schedule : " + bookAppointInfo.Schedule + " and Your Serial NO. : " + bookAppointInfo.SerialNo + ". Thank you for using HSSMI service."; SendSms sendSms = new SendSms(); sendSms.SendMessage(mobileNo, sendMessage); }
public Task SendAsync(IdentityMessage message) { var newmsg = new SmsMessage { Message = message.Body, Number = message.Destination, SenderId = "RASMED PUB" }; _messenger.SendMessage(newmsg); return(Task.FromResult(0)); }
protected void btnSave_Click(object sender, EventArgs e) { try { if (helper.ExecutePlainQuery("select * from tbl_BranchUser where Email='" + txtEmail.Text + "'").Rows.Count > 0 && String.IsNullOrEmpty(Convert.ToString(hfUserID.Value))) { lblmsg.Text = helper.DisplayNotificationMessage(msgDiv, txtEmail.Text + " already exists!", "alert alert-danger alert-icon alert-dismissible", icon, "icon mdi mdi-close-circle-o"); } else { string msg = "User detail has been added!"; TblBranchUser obj = new TblBranchUser(); obj.IsNew = true; if (!String.IsNullOrEmpty(Convert.ToString(hfUserID.Value))) { obj.IsNew = false; obj = new TblBranchUser(hfUserID.Value); msg = "User detail has been updated!"; } obj.BranchID = Convert.ToInt16(ddlBranches.SelectedValue); obj.UserName = txtUserName.Text; obj.Contact = txtContact.Text; obj.Email = txtEmail.Text; obj.Image = "N/A"; obj.Address = txtAddress.Text; obj.IsActive = true; if (obj.IsNew == true) { obj.IsFirst = true; obj.Password = helper.generateRandomCode(5); SendSms.SendMessage(txtContact.Text, "Your account has been registered! Your password is " + obj.Password); SendEmail.Mail(txtEmail.Text, "Password", "Your account has been registered! Your password is " + obj.Password); } obj.Save(); lblmsg.Text = helper.DisplayNotificationMessage(msgDiv, msg, "alert alert-success alert-icon alert-dismissible", icon, "icon mdi mdi-check"); helper.ClearInputs(Page.Controls); hfUserID.Value = string.Empty; // reqFile.Enabled = true; } } catch (Exception ex) { lblmsg.Text = helper.DisplayNotificationMessage(msgDiv, ex.ToString(), "alert alert-danger alert-icon alert-dismissible", icon, "icon mdi mdi-close-circle-o"); } }
protected void btnSendCode_Click(object sender, EventArgs e) { TblBranchUser obj = new TblBranchUser(TblBranchUser.Columns.Contact, txtContact.Text); if (!String.IsNullOrEmpty(obj.Contact)) { obj.IsNew = false; obj.VerificationCode = helper.generateRandomCode(5); SendSms.SendMessage(txtContact.Text, "Your password reset code is " + obj.VerificationCode); obj.Save(); divReset.Visible = false; divPasswordUpdate.Visible = true; } else { lblmsg.ForeColor = Color.Red; lblmsg.Text = "Invalid account contact no.!"; } }
protected void btnSubmit_Click(object sender, EventArgs e) { CheckBox chk = null; HiddenField hfStudentID = null, hfClassNo = null; bool IsPresent = true; for (int i = 0; i < rptStudents.Items.Count; i++) { chk = (CheckBox)rptStudents.Items[i].FindControl("chkAll"); hfStudentID = (HiddenField)rptStudents.Items[i].FindControl("hfStudentID"); //hfClassNo.Value = ; if (chk.Checked) { IsPresent = true; } else { IsPresent = false; } TblAttendance obj = new TblAttendance(); obj.IsNew = true; if (AttendaceID.Count != 0) { obj = new TblAttendance(AttendaceID[i]); obj.IsNew = false; } obj.BranchID = Convert.ToInt32(Session["BranchID"]); obj.StudentID = Convert.ToInt32(hfStudentID.Value); obj.ClassNo = Convert.ToInt32(ddlClass.SelectedValue); obj.AttendanceDate = helper.getDateTime(); obj.IsPresent = IsPresent; obj.Updateby = Session["BranchUserName"].ToString(); obj.Save(); } if (ddlClass.Items.Count > 1 && !String.IsNullOrEmpty(ddlClass.SelectedValue)) { DataTable dt = helper.ExecutePlainQuery("select * from TblStudents inner join tbl_Attendance on TblStudents.StudentID=tbl_Attendance.StudentID where CONVERT(date, AttendanceDate)=CONVERT(date,'" + helper.getDateTime() + "') and TblStudents.BranchID=" + Session["BranchID"] + " and tbl_Attendance.ClassNo=" + ddlClass.SelectedValue); string Student = null; string Description = null; string Contact = null; for (int i = 0; i <= dt.Rows.Count - 1; i++) { if (dt.Rows.Count > 0) { IsPresent = Convert.ToBoolean(dt.Rows[i]["IsPresent"]); if (!IsPresent) { if (dt.Rows[i]["Gender"].ToString() == "Male") { Student = "Son"; } else { Student = "Daughter"; } Description = "Dear " + dt.Rows[i]["GName"] + "sir! your " + Student + " is absent today! Regards: Pak Paerl school & colleges(" + Session["BranchUserName"] + ")"; Contact = dt.Rows[i]["GCellNo"].ToString(); SendSms.SendMessage(Contact, Description); } } } } AttendaceID.Clear(); ddlClass.Items.Clear(); ddlGroups.Items.Clear(); ddlLevel.SelectedValue = ""; // lblmsg.Text = helper.DisplayNotificationMessage(msgDiv, "", "alert alert-success alert-icon alert-dismissible", icon, "icon mdi mdi-check"); Response.Redirect("ManageAttendance.aspx?msg=" + helper.Encrypt("Attendance has been submited!")); LoadStudents(); }
public ActionResult AddNewMember(RegisterViewModel rvm) { if (ModelState.IsValid) { var user = new Member { UserName = rvm.Email, Email = rvm.Email, EmailConfirmed = true, PhoneNumber = rvm.MobileNumber, PhoneNumberConfirmed = true, TwoFactorEnabled = false, MemberProfile = new MemberProfile { FullName = rvm.FullName, RegistrationDate = DateTime.Now, Address = rvm.Address }, }; var result = UserManager.Create(user, rvm.Password); if (result.Succeeded) { StringWriter writer = new StringWriter(); HtmlTextWriter html = new HtmlTextWriter(writer); html.RenderBeginTag(HtmlTextWriterTag.H1); html.WriteEncodedText("User Registration Notification"); html.RenderEndTag(); html.WriteEncodedText("Dear Sir/Ma "); html.WriteBreak(); html.RenderBeginTag(HtmlTextWriterTag.P); html.WriteEncodedText("This is to notify you that you've been successfully registered on our platform. Kindly login with the details below"); html.RenderEndTag(); html.WriteBreak(); html.WriteBreak(); html.WriteEncodedText("Username : "******"Password : "******"url: evaluation.rasmedpublications.com"); html.WriteBreak(); html.WriteBreak(); html.WriteEncodedText("Should you encounter any problem or difficulty, kindly get in touch with us via the support page"); html.WriteBreak(); html.WriteBreak(); html.WriteEncodedText("Regards"); html.WriteBreak(); html.WriteEncodedText("Rasmed Publications HR Team"); html.Flush(); string htmlmsg = writer.ToString(); _mailPusher.SendEmail(user.Email, "Administrator", "*****@*****.**", "Successful User Registration", htmlmsg); var newmsg = new SmsMessage { Message = "You've been successfully added to Rasmed Publications Evaluation Platform. Kindly Check your E-mail for details", Number = rvm.MobileNumber, SenderId = "RASMED PUB" }; _messenger.SendMessage(newmsg); //sendmail and sms TempData["notification"] = "The Member has been successfully added"; return(RedirectToAction("Member")); } AddErrors(result); } return(View(rvm)); }
public bool SendMessage(long mobileNumber, string countryCode, string deviceId, string message, out int code) { return(SendSms.SendMessage(mobileNumber, countryCode, deviceId, message, out code)); }