Exemplo n.º 1
0
 public ActionResult ChangePassword()
 {
     var viewModel = new ChangePasswordViewModel();
     var user = _userService.GetUserByName(new GetUserByNameRequest { Name = User.Identity.Name });
     viewModel.Id = user.Id;
     return View(viewModel);
 }
Exemplo n.º 2
0
 public ActionResult CheckPassword(ChangePasswordViewModel model)
 {
     var response = new UpdateUserResponse();
     response = _userService.CheckPassword(new CheckPasswordRequest { Name = User.Identity.Name, Password = model.Old_Password });
     if (response.IsSuccess)
     {
         return Json(true, JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(false, JsonRequestBehavior.AllowGet);
     }
 }
Exemplo n.º 3
0
        public ActionResult ChangePassword(ChangePasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                //todo call change password service
                var response = _userService.ChangePassword(new ChangePasswordRequest { Id = model.Id, Old_Password = model.Old_Password, New_Password = model.New_Password });

                //ViewBag.Message = response.Message;
                @TempData["Message"] = response.Message;
                return RedirectToAction("Validate", new { Message = response.Message });
            }
            else
            {
                ModelState.AddModelError("", "Incorrect Login Credential");
            }
            return View(model);
        }