public ActionResult DeleteConfirmed(int id) { LibroPrestado libroPrestado = db.LibroPrestadoes.Find(id); db.LibroPrestadoes.Remove(libroPrestado); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }