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