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