public ActionResult DeleteConfirmed(int id) { ChemicalStore chemicalStore = db.ChemicalStores.Find(id); db.ChemicalStores.Remove(chemicalStore); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Item,Class,Price,CreatedDate,IsDeleted,CustomerId")] ChemicalStore chemicalStore) { if (ModelState.IsValid) { db.Entry(chemicalStore).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(chemicalStore)); }
public ActionResult Create([Bind(Include = "Id,Item,Class,Price,CreatedDate,IsDeleted,CustomerId")] ChemicalStore chemicalStore) { if (ModelState.IsValid) { db.ChemicalStores.Add(chemicalStore); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(chemicalStore)); }
// GET: ChemicalStores/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChemicalStore chemicalStore = db.ChemicalStores.Find(id); if (chemicalStore == null) { return(HttpNotFound()); } return(View(chemicalStore)); }