public ActionResult ConfirmChangePassword(string oldpass, string Pass, string cpass) { MDirectorRepository orepo = new MDirectorRepository(); LoginRepository lrepo = new LoginRepository(); MDirector of = orepo.Get(Convert.ToInt32(Session["Id"])); Logininfo log = lrepo.Get(Session["Name"].ToString()); if (Session["Password"].ToString() == oldpass) { if (Pass != cpass) { ViewData["Message"] = "Password Didn't match"; } else { of.MD_password = Pass; log.Login_Password = Pass; orepo.Update(of); lrepo.Update(log); ViewData["Message"] = "Password Updated Successfully"; Session["MD"] = of; Session["Password"] = Pass; } } else { ViewData["Message"] = "Wrong Password"; } return(View("Empty")); }
public ActionResult ConfirmEditProfile(MDirector md) { MDirectorRepository mrepo = new MDirectorRepository(); mrepo.Update(md); ViewData["Message"] = "Edit Successfull"; Session["MD"] = md; return(View("Empty")); }