public ActionResult ChangePassword(ChangepasswordModel model)
        {
            if (_workerContext.CurrentUserPersonalInformation.UserId != null)
            {
                if (ModelState.IsValid)
                {

                    string msg = _iUserService.ChangePassword(model.NewPassword, model.ConfirmPassword, model.OldPassword, model.Username);
                    if (string.IsNullOrWhiteSpace(msg))
                    {

                        //SuccessNotification("You have successfully changed your Password. Please Login with the new Password.");
                        TempData["password"] = "******";
                        return RedirectToAction("Logout", "Home");

                    }
                    else
                    {
                        ErrorNotification(new Exception(msg));
                        return View(model);

                    }

                }

                else
                {
                    ErrorNotification(new Exception("The new password and confirmation password do not match."));
                    return View(model);
                }

            }
            else return RedirectToAction("Default", "Default");
        }
        public ActionResult ChangePassword(string username, string OldPassword)
        {
            if (_workerContext.CurrentUserPersonalInformation.UserId != null)
            {
                ChangepasswordModel model = new ChangepasswordModel();

                model.Username = username;
                if (_workerContext.CurrentUserPersonalInformation != null)
                    model.Username = _workerContext.CurrentUserPersonalInformation.Email;
                model.OldPassword = OldPassword;

                return View(model);
            }
            else return RedirectToAction("Default", "Default");
        }
Beispiel #3
0
 public ActionResult ChangePassword()
 {
     ChangepasswordModel model = new ChangepasswordModel();
     return View(model);
 }