Exemple #1
0
 private void CarregarDropDownEvento(int?id)
 {
     if (id == null)
     {
         ViewBag.EventoList = new SelectList(_eventoApp.ListarPorUsuario(User.Identity.GetUserId()).OrderBy(e => e.Nome), "EventoId", "Nome");
     }
     else
     {
         ViewBag.EventoList = new SelectList(_eventoApp.ListarPorUsuario(User.Identity.GetUserId()).OrderBy(e => e.Nome), "EventoId", "Nome", id);
     }
 }
Exemple #2
0
        public ActionResult Index()
        {
            var listaEventos    = _eventoApp.ListarPorUsuario(User.Identity.GetUserId());
            var eventoViewModel = Mapper.Map <IEnumerable <Evento>, IEnumerable <EventoViewModel> >(listaEventos);

            eventoViewModel.Each(e => e.VagasUtilizadas = _participanteApp.ContarVagasUtilizadas(e.EventoId));
            return(View(eventoViewModel));
        }