public ActionResult Index()
        {
            var coord = _dbcoordenacao.ObterTodos();
            var mat   = UsuarioLogado.Perfis;

            if (mat.Contains(Acesso.Basico))
            {
                coord = _dbcoordenacao.ObterTodos().Where(c => c.T003_ID_COORDENACAO == UsuarioLogado.idCoordencao);
            }

            ViewBag.T003_ID_COORDENACAO = new SelectList(coord, "T003_ID_COORDENACAO", "T003_SG_COORDENACAO");
            modelInforme.t002_informe   = _informe.ObterTodos();


            return(View(modelInforme));
        }
        public ActionResult carregaForm(int?COORDENACAO)
        {
            IEnumerable <VW001_INFORME_ATUAL> viewInforme  = new List <VW001_INFORME_ATUAL>();
            IEnumerable <T002_INFORME>        informe      = new List <T002_INFORME>();
            RepositoryT002_INFORME            _dbInforme   = new RepositoryT002_INFORME();
            RepositoryVW001_INFORME_ATUAL     _dbVwInforme = new RepositoryVW001_INFORME_ATUAL();
            RepositoryT004_SEMANA             _semana      = new RepositoryT004_SEMANA();
            string competencia = _semana.ObterTodos().OrderByDescending(x => x.T004_ID_SEMANA).FirstOrDefault().T004_COMPETENCIA;
            var    semana      = _semana.ObterTodos().Where(x => x.T004_DT_FIM >= DateTime.Now.Date).FirstOrDefault().T004_NR_SEMANA_MES;

            ViewBag.coord  = COORDENACAO;
            ViewBag.Mat    = "DESKTOP-FABIA";
            ViewBag.comp   = competencia;
            ViewBag.semana = semana;

            informe = _dbInforme.ObterTodos();
            informe = informe.Where(i => i.T004_NR_SEMANA == semana && i.T003_ID_COORDENACAO == COORDENACAO && i.T002_COMPETENCIA == competencia).Take(2);

            viewInforme = _dbVwInforme.ObterTodos().Where(i => i.T003_ID_COORDENACAO == COORDENACAO).OrderByDescending(i => i.T002_ID_INFORME).Take(2);


            return(View("_carregaForm", viewInforme));
        }
예제 #3
0
        public IEnumerable <T002_INFORME> buscarInformes(int id, int indice)
        {
            t002_informe = _informe.ObterTodos().Where(x => x.T003_ID_COORDENACAO == id && x.T001_ID_INDICE_INFORME == indice);

            return(t002_informe);
        }