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