Example #1
0
 public HttpResponseMessage Post([FromBody] InvoiceModel InvoiceModel)
 {
     try
     {
         invoiceRepository.AddInvoiceNew(InvoiceModel);
         var formatter = RequestFormat.JsonFormaterString();
         return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
             output = "success", msg = "Approved successfully"
         }, formatter));
     }
     catch (Exception ex)
     {
         var formatter = RequestFormat.JsonFormaterString();
         return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
             output = "error", msg = ex.ToString()
         }, formatter));
     }
 }