public ActionResult ConcursoResidente() { ViewBag.Title = "Concurso para Residente Jurídico"; var model = new DocumentoRegras { Servico = new DocumentoDados() } .BuscarDocumentos((int)PortalRegras.Portais.SiteId, "Concurso - Residente Jurídico", string.Empty).OrderByDescending(doc => doc.DataPublicacao); return(View("Concursos", model)); }
public async Task <ActionResult> MovimentacaoDefensores() { var regra = new DocumentoRegras { Servico = new DocumentoDados() } .ListarPorPortal((int)PortalRegras.Portais.SiteId); var modelGroup = (from d in regra where d.TipoDocumento.Nome.Contains("Movimentação - Defensores") group d by d.DataPublicacao.Value.Year ).ToList(); var model = new List <DocumentoMovimentacaoViewModel>(); foreach (var colecao in modelGroup) { var docs = colecao.GroupBy(x => x.DataPublicacao.Value.Month).ToList(); foreach (var item in docs) { var doc = new DocumentoMovimentacaoViewModel { Mes = new DateTime(colecao.Key, item.Key, 1), Id = string.Format("{0}_{1,2:00}", colecao.Key, item.Key) }; var listaDocumentoItems = new List <DocumentoItemViewModel>(); item.ForEach(x => listaDocumentoItems.Add(new DocumentoItemViewModel { Titulo = x.Nome, Link = DicionarioPortalDPGE.uploadsArquivos + x.Arquivo.NomeServidor })); doc.ListaDocumentoItems = listaDocumentoItems; model.Add(doc); } } return(View(model.OrderByDescending(i => i.Id))); //var listaMovimentacao = (await _service.ObterListaMovimentacaoDefensoresAsync()).ToList(); //var ultimoAno = listaMovimentacao.OrderByDescending(lm => lm.DataPublicacao.Year).First().DataPublicacao.Year; //var model = MapeaListaMovimentacao(listaMovimentacao.Where(lm => lm.DataPublicacao.Year == ultimoAno)); //ViewBag.historico = false; //return View(model.OrderByDescending(i => i.Id)); }