public ActionResult DeleteConfirmed(int id) { Detalle_Evento_Patro detalle_Evento_Patro = db.Detalle_Evento_Patros.Find(id); db.Detalle_Evento_Patros.Remove(detalle_Evento_Patro); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Detalle_Evento_Patro/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Detalle_Evento_Patro detalle_Evento_Patro = db.Detalle_Evento_Patros.Find(id); if (detalle_Evento_Patro == null) { return(HttpNotFound()); } return(View(detalle_Evento_Patro)); }
public ActionResult Edit([Bind(Include = "Id,Desde,PatrocinadorId,EventoId,Hasta,Local_EventoId,Asistente_EventoId")] Detalle_Evento_Patro detalle_Evento_Patro) { if (ModelState.IsValid) { db.Entry(detalle_Evento_Patro).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Asistente_EventoId = new SelectList(db.Asistente_Eventos, "Id", "Id", detalle_Evento_Patro.Asistente_EventoId); ViewBag.EventoId = new SelectList(db.Eventos, "Id", "Cod_Evento", detalle_Evento_Patro.EventoId); ViewBag.Local_EventoId = new SelectList(db.Local_Eventos, "Id", "Nombre", detalle_Evento_Patro.Local_EventoId); ViewBag.PatrocinadorId = new SelectList(db.Personas, "Id", "Cod_Persona", detalle_Evento_Patro.PatrocinadorId); return(View(detalle_Evento_Patro)); }
// GET: Detalle_Evento_Patro/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Detalle_Evento_Patro detalle_Evento_Patro = db.Detalle_Evento_Patros.Find(id); if (detalle_Evento_Patro == null) { return(HttpNotFound()); } ViewBag.Asistente_EventoId = new SelectList(db.Asistente_Eventos, "Id", "Id", detalle_Evento_Patro.Asistente_EventoId); ViewBag.EventoId = new SelectList(db.Eventos, "Id", "Cod_Evento", detalle_Evento_Patro.EventoId); ViewBag.Local_EventoId = new SelectList(db.Local_Eventos, "Id", "Nombre", detalle_Evento_Patro.Local_EventoId); ViewBag.PatrocinadorId = new SelectList(db.Personas, "Id", "Cod_Persona", detalle_Evento_Patro.PatrocinadorId); return(View(detalle_Evento_Patro)); }
public ActionResult Create([Bind(Include = "Id,Desde,PatrocinadorId,EventoId,Hasta,Local_EventoId,Asistente_EventoId")] Detalle_Evento_Patro detalle_Evento_Patro) { if (ModelState.IsValid) { db.Detalle_Evento_Patros.Add(detalle_Evento_Patro); db.SaveChanges(); return(RedirectToAction("Index")); } else if (!ModelState.IsValid) { return(RedirectToAction("Index")); } ViewBag.Asistente_EventoId = new SelectList(db.Asistente_Eventos, "Id", "Id", detalle_Evento_Patro.Asistente_EventoId); ViewBag.EventoId = new SelectList(db.Eventos, "Id", "Nombre_Evento", detalle_Evento_Patro.EventoId); ViewBag.Local_EventoId = new SelectList(db.Local_Eventos, "Id", "Nombre", detalle_Evento_Patro.Local_EventoId); ViewBag.PatrocinadorId = new SelectList(db.Personas, "Id", "Nombres", detalle_Evento_Patro.PatrocinadorId); return(View(detalle_Evento_Patro)); }