public ActionResult ChangePass(ChangePasswordModel model) { if (IsValidSessions()) { if (model.NewPassword == model.ConfirmPassword) { if (EDefineUser.IsTruePassword(Convert.ToInt32(Session["admin"].ToString()), model.OldPassword)) { UserAccount DefineUser = _RUser.UserAccountDetails(Convert.ToInt32(Session["admin"].ToString())); DefineUser.EncrypedPass =Common.CommonMethods.Encrypt(model.NewPassword); _RUser.SaveUserAccount(DefineUser); } } return RedirectToAction("succ"); } else return JavaScript("window.location.href ='/Admin/Home/Login';"); }
public ActionResult ChangePassByAdmin(int dpUserList, ChangePasswordModel model) { if (IsValidSessions()) { EDefineUser.ChangePassByAdmin(dpUserList, model.NewPassword); ViewBag.result = "OK"; return RedirectToAction("succ"); } else return JavaScript("window.location.href ='/Admin/Home/Login';"); }