public SalesController() { categoriesB = new CategoriesB(); subCategoriesB = new SubCategoriesB(); accountB = new AccountsB(); userB = new UsersB(); saleB = new SalesB(); assetsLiabilitiesB = new AssetsLiabilitiesB(); clientsB = new ClientsB(); productsB = new ProductsB(); detailsB = new DetailsB(); invoicesB = new InvoicesB(); providersB = new ProvidersB(); }
// DELETE: api/Sale/5 public IHttpActionResult Delete(int id) { int sale; SalesB salesB = new SalesB(); sale = salesB.Delete(id); switch (sale) { case 200: return(Ok(200)); case 500: return(Ok(500)); default: return(Ok(false)); } }
public IHttpActionResult Post(Sales sales) { int sale; SalesB salesB = new SalesB(); sale = salesB.Create(sales); switch (sale) { case 200: return(Ok(200)); case 500: return(Ok(500)); default: return(Ok(false)); } }