Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LibroPrestado libroPrestado = db.LibroPrestadoes.Find(id);

            db.LibroPrestadoes.Remove(libroPrestado);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "PrestamoId,LectorID,LibroID")] LibroPrestado libroPrestado)
 {
     if (ModelState.IsValid)
     {
         db.Entry(libroPrestado).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LectorID = new SelectList(db.Lectors, "LectorID", "Nombre", libroPrestado.LectorID);
     ViewBag.LibroID  = new SelectList(db.Libros, "LibroID", "Nombre", libroPrestado.LibroID);
     return(View(libroPrestado));
 }
Exemple #3
0
        // GET: LibroPrestadoes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LibroPrestado libroPrestado = db.LibroPrestadoes.Find(id);

            if (libroPrestado == null)
            {
                return(HttpNotFound());
            }
            return(View(libroPrestado));
        }
Exemple #4
0
        // GET: LibroPrestadoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LibroPrestado libroPrestado = db.LibroPrestadoes.Find(id);

            if (libroPrestado == null)
            {
                return(HttpNotFound());
            }
            ViewBag.LectorID = new SelectList(db.Lectors, "LectorID", "Nombre", libroPrestado.LectorID);
            ViewBag.LibroID  = new SelectList(db.Libros, "LibroID", "Nombre", libroPrestado.LibroID);
            return(View(libroPrestado));
        }