public ActionResult ChangePassword(FormCollection formCollection) { PrinciUtil princiUtil = new PrinciUtil(); Principal principal = princiUtil.GetPrincipalID(Convert.ToInt32(Session["PrincipalID"])); string OldPassword = Convert.ToString(formCollection["OldPassword"]); string NewPassword = Convert.ToString(formCollection["NewPassword"]); if (principal.Password == OldPassword) { if (princiUtil.UpdatePrincipalPassword(NewPassword, principal.ID)) { Session["Notification"] = 3; } else { Session["Notification"] = 4; } } else { Session["Notification"] = 5; } return RedirectToAction("Settings"); }
public ActionResult Settings() { PrinciUtil princiUtil = new PrinciUtil(); return View( princiUtil.GetPrincipalID(Convert.ToInt32(Session["PrincipalID"])) ); }