public ActionResult DeleteConfirmed(string id) { Res_Prod res_Prod = db.Res_Prod.Find(id); db.Res_Prod.Remove(res_Prod); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "num_Res,id_Prod,cantidad_Reservada,fecha_Reserva")] Res_Prod res_Prod) { if (ModelState.IsValid) { db.Entry(res_Prod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_Prod = new SelectList(db.Productos, "id_Prod", "nombre_Prod", res_Prod.id_Prod); ViewBag.num_Res = new SelectList(db.Reservas, "num_Res", "dni_Cli", res_Prod.num_Res); return(View(res_Prod)); }
public ActionResult Create([Bind(Include = "num_Res,id_Prod,cantidad")] Res_Prod res_Prod) { if (ModelState.IsValid) { db.Res_Prod.Add(res_Prod); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_Prod = new SelectList(db.Productos, "id_Prod", "nombre_Prod", res_Prod.id_Prod); ViewBag.num_Res = new SelectList(db.Reservas, "num_Res", "dni_Cli", res_Prod.num_Res); return(View(res_Prod)); }
// GET: Res_Prod/Details/5 public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Res_Prod res_Prod = db.Res_Prod.Find(id); if (res_Prod == null) { return(HttpNotFound()); } return(View(res_Prod)); }
// GET: Res_Prod/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Res_Prod res_Prod = db.Res_Prod.Find(id); if (res_Prod == null) { return(HttpNotFound()); } ViewBag.id_Prod = new SelectList(db.Productos, "id_Prod", "nombre_Prod", res_Prod.id_Prod); ViewBag.num_Res = new SelectList(db.Reservas, "num_Res", "dni_Cli", res_Prod.num_Res); return(View(res_Prod)); }