Example #1
0
 public OperationStatus TryUpdateUserPassword(UserPasswordUpdteClient userPasswordUpdate)
 {
     try
     {
         OperationStatus status = _userWork.UpdatePassword(userPasswordUpdate.UserName, userPasswordUpdate.OldPassword, userPasswordUpdate.NewPassword);
         userPasswordUpdate.ServerStatus = true;
         return(status);
     }
     catch
     {
         userPasswordUpdate.ServerStatus = false;
         return(OperationStatus.GenericError);
     }
 }
        public ClientModel UpdatePassword([FromBody] UserPasswordUpdteClient user)
        {
            if (user == null)
            {
                return(null);
            }

            OperationStatus status = _accountDriver.TryUpdateUserPassword(user);

            if (status == OperationStatus.PasswordUpdateSuccess)
            {
                user.AddSuccessNotification(MessageManager.GetMessage(status));
            }
            else
            {
                user.AddErrorNotification(MessageManager.GetMessage(status));
            }

            return(user);
        }