Exemplo n.º 1
0
        public async Task <IHttpActionResult> CreateInvoice()
        {
            var httpContext = System.Web.HttpContext.Current;

            if (httpContext.Request.Files.Count > 0)
            {
                var(IsSuccess, ErrorMessage) = await invoicesProvider.CreateInvoice(httpContext.Request.Files);

                if (IsSuccess)
                {
                    return(Ok());
                }
                else
                {
                    BadRequest(ErrorMessage);
                }
            }

            return(BadRequest());
        }
Exemplo n.º 2
0
 public Task CreateInvoice([FromBody] InvoiceRequest invoice)
 {
     return(_invoicesProvider.CreateInvoice(invoice));
 }