Beispiel #1
0
 public override APIResponse Delete(ICardDetails CardDetailsObj)
 {
     try
     {
         bool AuthUserResponseObj = new Security(UserProfileObj).AuthenticateUser();
         if (AuthUserResponseObj == true)
         {
             if (0 == CardDetailsDataLayerObj.Delete(CardDetailsObj))
             {
                 return(APIResponse.NOT_OK);
             }
             else
             {
                 return(APIResponse.OK);
             }
         }
         else
         {
             return(APIResponse.NOT_AUTHENTICATED);
         }
     }
     catch (NullReferenceException nex)
     {
         Logger.Instance().Log(Warn.Instance(), new LogInfo("Received null reference while removing card (Routine : AuthenticateUser), might be token manipulation. Check token : " + UserProfileObj.GetToken()));
         throw nex;
     }
     catch (MySqlException mse)
     {
         Logger.Instance().Log(Warn.Instance(), mse);
         throw mse;
     }
     catch (Exception ex)
     {
         Logger.Instance().Log(Fatal.Instance(), ex);
         throw ex;
     }
 }
 public override APIResponse Delete(IStores StoreObj)
 {
     try
     {
         bool Response = new Security(UserProfileObj).AuthenticateAdmin();
         if (Response == true)
         {
             if (0 == StoresTemplateObj.Delete(StoreObj))
             {
                 return(APIResponse.NOT_OK);
             }
             else
             {
                 return(APIResponse.OK);
             }
         }
         else
         {
             return(APIResponse.NOT_AUTHENTICATED);
         }
     }
     catch (NullReferenceException nex)
     {
         Logger.Instance().Log(Warn.Instance(), new LogInfo("Received null reference while removing store (Routine : AuthenticateAdmin), might be token manipulation. Check token : " + UserProfileObj.GetToken()));
         throw nex;
     }
     catch (MySqlException mse)
     {
         Logger.Instance().Log(Warn.Instance(), mse);
         throw mse;
     }
     catch (Exception ex)
     {
         Logger.Instance().Log(Fatal.Instance(), ex);
         throw ex;
     }
 }