public ActionResult Create(Customer customer) { if (ModelState.IsValid) { db.Customers.Add(customer); db.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public ProductSold CreateSales(ProductSold productSold) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } db.ProductSolds.Add(productSold); db.SaveChanges(); return(productSold); }
public Customer CreateCustomer(Customer customer) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } db.Customers.Add(customer); db.SaveChanges(); return(customer); }
public Store CreateStore(Store store) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } db.Stores.Add(store); db.SaveChanges(); return(store); }