Exemplo n.º 1
0
        public async Task <GrupoDetailsDTO> DetailsAsync(string GrupoId)
        {
            Grupo grupo = await _repository.FindAsync(g => g.Id == GrupoId);

            IEnumerable <AnuncioDTO> list = await(from a in _context.Set <Anuncio>()
                                                  where a.GroupId == GrupoId
                                                  orderby a.Orden
                                                  select new AnuncioDTO(a))
                                            .ToListAsync();

            double costoAnuncio = await _financieroService.CostoAnuncio(grupo.UserId);

            IEnumerable <TemporizadorDTO> listT = (from t in (await _temporizadorService.GetByGroup(GrupoId)).AsQueryable()
                                                   select new TemporizadorDTO(t, list.Where(a => a.Enable == true).Count(), costoAnuncio)).AsEnumerable();

            GrupoDetailsDTO model = new GrupoDetailsDTO(grupo, list, listT);

            return(model);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Details(string GrupoId)
        {
            GrupoDetailsDTO model = await _grupoService.DetailsAsync(GrupoId);

            return(View(model));
        }
Exemplo n.º 3
0
        private async Task <IActionResult> BuildPartialDetailsView(string GrupoId)
        {
            GrupoDetailsDTO grupoDetails = await _grupoService.DetailsAsync(GrupoId);

            return(PartialView("Details", grupoDetails));
        }