Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LIVRE lIVRE = db.LIVRESet.Find(id);

            db.LIVRESet.Remove(lIVRE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        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));
        }
Example #4
0
        // 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));
        }
Example #5
0
        // 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));
        }