public ActionResult ResetPassword(ResetPasswordViewModel model) { String msg = ""; String Code = Convert.ToString(TempData["Code"]); if (ModelState.IsValid) { if (!String.IsNullOrEmpty(model.UserId)) { msg = userregistrationData.UpdatePassword(model.UserId, model.Password, 2); } else { msg = "Invalid Operation!"; } if (msg == "") { String Msg = emailalert.SendPasswordUpdateEmail("", "", model.UserId); Code = null; msg = "Password updated successfully" + Msg; } TempData["IsValid"] = msg; return(RedirectToAction("ResetPassword", "UserAccount", routeValues: new { ActivationCode = Code })); } return(View(model)); }
public JsonResult UpdateUserPassword(String oldPwd, String newPwd) { String msg = pdata.UpdatePassword(SessionData.UserID, oldPwd, newPwd); if (msg == "") { var res = dashboardData.GetAlertData(SessionData.UserID); SessionData.AlertCount = res.Count; String FirstName = HttpContext.User.Identity.Name; String emailConfirm = ealert.SendPasswordUpdateEmail(FirstName, SessionData.LastName, SessionData.Email); msg += emailConfirm; } return(new JsonResult() { Data = msg, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }