Пример #1
0
        public ResponseApi Post([FromBody] Objects.InvoicementDataObject FormData)
        {
            Invoicement ObjInvoicement = new Invoicement();

            ObjInvoicement.CompanyId = Convert.ToInt32(FormData.CompanyId);
            ObjInvoicement.ClientId  = Convert.ToInt32(FormData.ClientId);
            ObjInvoicement.Products  = FormData.Products;
            ObjInvoicement.Total     = Convert.ToInt32(FormData.Total);
            bool        resultTransaction = ObjInvoicement.CreateInvoice();
            ResponseApi ObjResponseApi    = new ResponseApi();

            ObjResponseApi.Result = resultTransaction;
            if (resultTransaction)
            {
                ObjResponseApi.Message = "The Invoice was created!";
            }
            else
            {
                ObjResponseApi.Message = "Error, try again.";
            }
            return(ObjResponseApi);
        }
Пример #2
0
        public List <CoreInvoice> Get()
        {
            Invoicement ObjInvoicement = new Invoicement();

            return(ObjInvoicement.GetInvoices().ToList());
        }