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