public ActionResult DeleteConfirmed(int id) { FabricSupplier fabricSupplier = db.FabricSupplier.Find(id); db.FabricSupplier.Remove(fabricSupplier); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] FabricSupplier fabricSupplier) { if (ModelState.IsValid) { db.Entry(fabricSupplier).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fabricSupplier)); }
public ActionResult Create([Bind(Include = "Id,Name")] FabricSupplier fabricSupplier) { if (ModelState.IsValid) { db.FabricSupplier.Add(fabricSupplier); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fabricSupplier)); }
// GET: FabricSuppliers/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FabricSupplier fabricSupplier = db.FabricSupplier.Find(id); if (fabricSupplier == null) { return(HttpNotFound()); } return(View(fabricSupplier)); }