Beispiel #1
0
        // GET: EventoEquipos/Delete/5
        public ActionResult Delete(decimal eventoId, decimal equipamentoId)
        {
            Evento_Equipamento  eventoEquipamento = _eventoEquipamentoService.GetByIds(eventoId, equipamentoId);
            IList <Equipamento> equipos           = _equiposService.GetAll <Equipamento>();

            ViewData["EquiposLista"] = new SelectList(equipos, "EquipamentoId", "Nombre");
            ViewData["EventoId"]     = eventoId;
            return(View(eventoEquipamento));
        }
Beispiel #2
0
        // GET: EventoEquipos/Create
        public ActionResult Create(decimal eventoId)
        {
            Evento_Equipamento eventoEquipamento = new Evento_Equipamento();

            eventoEquipamento.EventoId = eventoId;
            pEventoId = eventoId;
            SetEnttyDataToForm(eventoId);
            ViewData["EventoId"] = eventoId;
            return(View(eventoEquipamento));
        }
Beispiel #3
0
 public ActionResult Delete(FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         decimal            eventoId          = Decimal.Parse(collection["EventoId"].ToString());
         decimal            equipamentoId     = Decimal.Parse(collection["EquipamentoId"].ToString());
         Evento_Equipamento eventoEquipamento = _eventoEquipamentoService.GetByIds(eventoId, equipamentoId);
         _eventoEquipamentoService.Delete(eventoEquipamento);
         Evento evento = _eventoService.GetById(eventoId);
         return(RedirectToAction("Index", "Evento", new { areaId = evento.AreaId }));
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Beispiel #4
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         // TODO: Add insert logic here
         Evento_Equipamento eventoEquipamento = new Evento_Equipamento();
         eventoEquipamento.EventoId      = pEventoId;
         eventoEquipamento.EquipamentoId = Decimal.Parse(collection["EquipamentoId"].ToString());
         eventoEquipamento.Cantidad      = Decimal.Parse(collection["Cantidad"].ToString());
         _eventoEquipamentoService.Create(eventoEquipamento);
         Evento evento = _eventoService.GetById(pEventoId);
         return(RedirectToAction("Index", "Evento", new { areaId = evento.AreaId }));
     }
     catch (Exception ex)
     {
         SetEnttyDataToForm(pEventoId);
         return(View());
     }
 }