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