public ActionResult DeleteConfirmed(int id) { LIVRE lIVRE = db.LIVRESet.Find(id); db.LIVRESet.Remove(lIVRE); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id_livre,titre_livre,USERId_user")] LIVRE lIVRE) { if (ModelState.IsValid) { db.Entry(lIVRE).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.USERId_user = new SelectList(db.USERSet, "Id_user", "nom_user", lIVRE.USERId_user); return(View(lIVRE)); }
public ActionResult Create([Bind(Include = "Id_livre,titre_livre,USERId_user")] LIVRE lIVRE) { if (ModelState.IsValid) { db.LIVRESet.Add(lIVRE); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.USERId_user = new SelectList(db.USERSet, "Id_user", "nom_user", lIVRE.USERId_user); return(View(lIVRE)); }
// GET: LIVRE/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LIVRE lIVRE = db.LIVRESet.Find(id); if (lIVRE == null) { return(HttpNotFound()); } return(View(lIVRE)); }
// GET: LIVRE/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LIVRE lIVRE = db.LIVRESet.Find(id); if (lIVRE == null) { return(HttpNotFound()); } ViewBag.USERId_user = new SelectList(db.USERSet, "Id_user", "nom_user", lIVRE.USERId_user); return(View(lIVRE)); }