Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
 public ActionResult ChangePassword()
 {
     ChangepasswordModel model = new ChangepasswordModel();
     return View(model);
 }