Exemplo n.º 1
0
 public IHttpActionResult DeleteItem(int one_time_payment_key)
 {
     try
     {
         OneTimePaymentRepository dbData = new OneTimePaymentRepository(dbCxt);
         dbData.DeleteItem(one_time_payment_key);
         return(Ok(true));
     }
     catch (Exception exError)
     {
         if (exError.InnerException != null)
         {
             return(BadRequest((new Error(0, exError.InnerException.ToString(), "DeleteItem").ToString())));
         }
         return(BadRequest((new Error(0, exError.Message, "DeleteItem").ToString())));
     }
 }
Exemplo n.º 2
0
        public IHttpActionResult CreateItem(OneTimePaymentDTO record)
        {
            try
            {
                OneTimePaymentRepository dbData = new OneTimePaymentRepository(dbCxt);

                return(Ok(dbData.CreateItem(record)));
            }
            catch (Exception exError)
            {
                if (exError.InnerException != null)
                {
                    return(BadRequest((new Error(0, exError.InnerException.ToString(), "CreateItem").ToString())));
                }
                return(BadRequest((new Error(0, exError.Message, "CreateItem").ToString())));
            }
        }