示例#1
0
 public virtual ActionResult ResetPassword(ResetPasswordModel password, string @return)
 {
     var data = new JsonResultData(ModelState);
     if (ModelState.IsValid)
     {
         data.RunWithTry((resultData) =>
         {
             UserManager.ChangePassword(password.UserName, password.NewPassword);
             data.RedirectUrl = @return;
         });
     }
     return Json(data);
 }
示例#2
0
        public virtual ActionResult ResetPassword(ResetPasswordModel password)
        {
            JsonResultEntry resultEntry = new JsonResultEntry(ModelState);
            try
            {
                ServiceFactory.UserManager.ChangePassword(password.UserName, password.NewPassword);
            }
            catch (Exception e)
            {
                resultEntry.AddException(e);
            }

            return Json(resultEntry);
        }