public ActionResult DeleteConfirmed(int id) { detallePrestamo detallePrestamo = db.detallePrestamo.Find(id); db.detallePrestamo.Remove(detallePrestamo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,idLibro,idPrestamo,cantidad")] detallePrestamo detallePrestamo) { if (ModelState.IsValid) { db.Entry(detallePrestamo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idLibro = new SelectList(db.Libro, "Id_libro", "Titulo", detallePrestamo.idLibro); ViewBag.idPrestamo = new SelectList(db.Prestamo, "Id_prestamo", "Estado", detallePrestamo.idPrestamo); return(View(detallePrestamo)); }
// GET: detallePrestamoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } detallePrestamo detallePrestamo = db.detallePrestamo.Find(id); if (detallePrestamo == null) { return(HttpNotFound()); } return(View(detallePrestamo)); }
// GET: detallePrestamoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } detallePrestamo detallePrestamo = db.detallePrestamo.Find(id); if (detallePrestamo == null) { return(HttpNotFound()); } ViewBag.idLibro = new SelectList(db.Libro, "Id_libro", "Titulo", detallePrestamo.idLibro); ViewBag.idPrestamo = new SelectList(db.Prestamo, "Id_prestamo", "Estado", detallePrestamo.idPrestamo); return(View(detallePrestamo)); }
public ActionResult DetallesPrestamo(int IdLibro, int cantidad) { if ((IdLibro > 0 || IdLibro != null) && (cantidad > 0 || cantidad != null)) { detallePrestamo item = new detallePrestamo(); item.Libro = db.Libro.Find(IdLibro); item.idLibro = IdLibro; item.cantidad = cantidad; detalleAux.Add(item); return(PartialView(detalleAux)); } else { return(PartialView(detalleAux)); } }