public ActionResult DeleteConfirmed(int id) { RESERVAS rESERVAS = db.RESERVAS.Find(id); db.RESERVAS.Remove(rESERVAS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id_Usuario,Id_Mesa,Dia,Hora,Num_personas")] RESERVAS rESERVAS) { if (ModelState.IsValid) { db.RESERVAS.Add(rESERVAS); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Id_Mesa = new SelectList(db.MESAS, "Id", "Descripcion", rESERVAS.Id_Mesa); ViewBag.Id_Usuario = new SelectList(db.USUARIOS, "Id", "Nombre", rESERVAS.Id_Usuario); return(View(rESERVAS)); }
//public ActionResult Locales() //{ // return View(db.LOCALES.ToList()); //} // GET: Reservas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RESERVAS rESERVAS = db.RESERVAS.Find(id); if (rESERVAS == null) { return(HttpNotFound()); } return(View(rESERVAS)); }