public ActionResult EditContactDetails() { ProfileBusiness pb = new ProfileBusiness(); if (User.IsInRole("Policy Holder")) { return(View(pb.getContactDetails(HttpContext.User.Identity.Name))); } TempData["Error"] = "You are not recognized as a Policy Holder, Therefore some content was hiden for privacy"; return(View()); }
public ActionResult applyToRemoveBeneficiary(string reason, int x = 0) { if (!String.IsNullOrEmpty(Session["benefIDNum"].ToString())) { ProfileBusiness pb = new ProfileBusiness(); ViewBag.Feedback = pb.applyToRemoveBen(HttpContext.User.Identity.Name, Session["benefIDNum"].ToString(), reason); var EB = new EmailBusiness(); EB.to = new MailAddress(pb.getContactDetails(HttpContext.User.Identity.Name).emailAdress); EB.sub = "Application Recieved - Mpiti Funeral Undertakers"; EB.body = "This is to confirm that your application for uncovering one beneficiary was recieved for our kind consideration." + "<br/>Look forward to recieve a report in 3 to 5 working days.. " + "<br/><br/> Regards<br/><b>Mpiti Funeral Undertakers - Communications Team</b>"; EB.Notification(); return(RedirectToAction("Feedback", new { message = ViewBag.Feedback })); } ViewBag.Feedback = "Please select a beneficiary to remove by navigating to Benefiaries under your Profile"; return(View()); }
public ActionResult Index(ChangePasswordViewModel model) { if (ModelState.IsValid) { IdentityUser user = UserManager.FindByName(HttpContext.User.Identity.Name); IdentityResult result = UserManager.ChangePassword(user.Id, model.OldPassword, model.NewPassword); if (result.Succeeded) { IAuthenticationManager authenticationManager = HttpContext.GetOwinContext().Authentication; //Record this in the event log try { ProfileActivityLog pal = new ProfileActivityLog() { IDNumber = HttpContext.User.Identity.Name, EventDate = DateTime.Now, Activity = "Changed your password" }; db.ProfileActivityLogs.Add(pal); db.SaveChanges(); var pb = new ProfileBusiness(); var EB = new EmailBusiness(); EB.to = new MailAddress(pb.getContactDetails(HttpContext.User.Identity.Name).emailAdress); EB.sub = "Password Changed"; EB.body = "This is to alert you that your password was recently changed." + "<br/><br/> Regards<br/><b>Mpiti Funeral Undertakers - Security Team</b>"; EB.Notification(); } catch (Exception ex) { } authenticationManager.SignOut(); return(RedirectToAction("Index", "Home")); } else { ModelState.AddModelError("", "changing the password."); } } return(View(model)); }
public ActionResult AddDocuments(DocumentViewModel model, HttpPostedFileBase upload) { if (ModelState.IsValid) { byte[] uploadedFile = new byte[upload.InputStream.Length]; upload.InputStream.Read(uploadedFile, 0, uploadedFile.Length); model.document = uploadedFile; var pb = new ProfileBusiness(); pb.UploadDocument(model); if (pb.NumberOfOutstandingDocs(HttpContext.User.Identity.Name) == 0) { var EB = new EmailBusiness(); EB.to = new MailAddress(pb.getContactDetails(HttpContext.User.Identity.Name).emailAdress); EB.sub = "Application Recieved - Mpiti Funeral Undertakers"; EB.body = "This is to confirm that your application for adding one more beneficiary was recieved for our kind consideration." + "<br/>Look forward to recieve a report in 3 to 5 working days.. " + "<br/><br/> Regards<br/><b>Mpiti Funeral Undertakers - Communications Team</b>"; EB.Notification(); ViewBag.Feedback = "Application submitted, look forward to recieve a report in 3 to 5 working days.."; return(RedirectToAction("Feedback", new { message = ViewBag.Feedback })); } } return(RedirectToAction("attachDocuments")); }