Agribusiness.Web.Controllers.PersonController.ResetPassword C# (CSharp) Method

ResetPassword() private method

private ResetPassword ( int id ) : System.Web.Mvc.ActionResult
id int
return System.Web.Mvc.ActionResult
        public ActionResult ResetPassword(int id)
        {
            var person = _personRepository.GetNullableById(id);

            if (person != null)
            {
                var password = _membershipService.ResetPasswordNoEmail(person.User.LoweredUserName);

                if (string.IsNullOrWhiteSpace(password))
                {
                    Message = "Password reset failed.";
                }
                else
                {
                    Message = string.Format("Password has been reset to {0}", password);
                }

                return this.RedirectToAction("AdminEdit", new { id = person.User.Id });
            }

            return this.RedirectToAction("Index");
        }