private ActionResult ChangePasswordView(ChangePasswordViewModel model)
 {
     return View( ViewNames.ChangePassword, model);
 }
 public async Task<ActionResult> ChangePassword(ChangePasswordViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return ChangePasswordView(model);
     }
     var result = await UserManager.ChangePasswordAsync(UserId, model.OldPassword, model.NewPassword);
     if (!result.Succeeded)
     {
         AddErrors(result);
         return ChangePasswordView(model);
     }
     var user = await UserManager.FindByIdAsync(UserId);
     if (user != null)
     {
         await SignInAsync(user);
     }
     return RedirectToIndex(ManageMessageId.ChangePasswordSuccess);
 }
 public async Task<ActionResult> ChangePassword(ChangePasswordViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword);
     if (result.Succeeded)
     {
         var user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
         if (user != null)
         {
             await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
         }
         return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess });
     }
     AddErrors(result);
     return View(model);
 }