public ActionResult DeleteConfirmed(int id) { Mechant mechant = db.Mechants.Find(id); db.Mechants.Remove(mechant); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MechantID,CivilID,Pseudonyme,Image_Mechant,Disponible")] Mechant mechant) { if (ModelState.IsValid) { db.Entry(mechant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MechantID = new SelectList(db.Civils, "CivilID", "Prenom", mechant.MechantID); return(View(mechant)); }
// GET: Mechants/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mechant mechant = db.Mechants.Find(id); if (mechant == null) { return(HttpNotFound()); } return(View(mechant)); }
// GET: Mechants/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mechant mechant = db.Mechants.Find(id); if (mechant == null) { return(HttpNotFound()); } ViewBag.MechantID = new SelectList(db.Civils, "CivilID", "Prenom", mechant.MechantID); return(View(mechant)); }