Esempio n. 1
0
 public IHttpActionResult ChangePassword(AccountInput param)
 {
     if (param != null)
     {
         if (!string.IsNullOrWhiteSpace(param.password))
         {
             if (!string.IsNullOrWhiteSpace(param.password_new))
             {
                 try
                 {
                     accountApp.ChangeMemberPassword(base.AccountCode, param.password, param.password_new, base.ClientId);
                     return(Ok());
                 }
                 catch (LockedUpMemberException)
                 {
                     return(BadRequest("locked_member"));
                 }
                 catch (PasswordException ex)
                 {
                     return(BadRequest(ex.Message));
                 }
                 catch (ArgumentException ex)
                 {
                     return(BadRequest(ex.Message));
                 }
                 catch (Exception ex)
                 {
                     return(InternalServerError(ex));
                 }
             }
             else
             {
                 return(BadRequest("passwordNew"));
             }
         }
         else
         {
             return(BadRequest("password"));
         }
     }
     else
     {
         return(BadRequest());
     }
 }