Exemplo n.º 1
0
    protected void ChangePassword(object sender, EventArgs e)
    {
        UsersManager um = new UsersManager();

        try
        {
            um.ChangePassword(this.txtUserId.Value, this.txtUserPass.Value);
            saveMessage.Text = "<div class='db-alert db-success hideMe'>Data updated successfully</div>";
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine("Exception caught. " + ex.Message);
            saveMessage.Text = "<div class='db-alert db-error hideMe'>Warning! Data not updated </div>";
        }
    }
Exemplo n.º 2
0
        public ActionResult <dynamic> ChangePassword(Users user)
        {
            string message = null;

            if (usersManager.ChangePassword(user.recovery_token,
                                            user.user_password, user.user_confirm_password, ref message))
            {
                return(new
                {
                    success = true,
                    message = "Change user password."
                });
            }
            return(Return500Error(message));
        }
Exemplo n.º 3
0
        public IActionResult ChangePassword(ChangePassword password)
        {
            ResponseDTO <ChangePasswordDTO> response = new ResponseDTO <ChangePasswordDTO>();
            ListDTO <ChangePasswordDTO>     list     = new ListDTO <ChangePasswordDTO>();

            list          = _userManager.ChangePassword(password);
            response.Data = new ListDTO <ChangePasswordDTO>();
            if (list != null)
            {
                response.Data    = list;
                response.Message = "Your user is updated!";
                response.Success = true;
                return(Ok(response));
            }
            response.Data    = null;
            response.Message = "An error occured, please try again!";
            response.Success = false;

            return(NotFound(response));
        }