Exemplo n.º 1
0
        public ProfessorForaSedeController(ProfessorIESContext _professorContext, CampusContext _campusContext, RegimeContext _regimeContext, IConfiguration _configuration)
        {
            if (dicProfessorCampus == null)
            {
                dicProfessorCampus = CampusProfessor.getCampusProfessor(_configuration);
            }

            this.Configuration = _configuration;
            this.CampusContext = _campusContext;

            this.ProfessorIESContext = _professorContext;

            this.RegimeContext = _regimeContext;
        }
Exemplo n.º 2
0
        public RegulatorioController(ProfessorIESContext Context
                                     , ProfessorContext ProfContext
                                     , RegimeContext regimeContext
                                     , CensoContext CContext
                                     , CargaContext cargaContext
                                     , CampusContext _campusContext
                                     , ProfessorMatriculaContext _matContext
                                     , IConfiguration _configuration)
        {
            if (dicProfessorCampus == null)
            {
                dicProfessorCampus = CampusProfessor.getCampusProfessor(_configuration);
            }

            this.Context          = Context;
            this.Profcontext      = ProfContext;
            this.RegContext       = regimeContext;
            this.CContext         = CContext;
            this.CgContext        = cargaContext;
            this.CampusContext    = _campusContext;
            this.MatriculaContext = _matContext;

            this.listaForaSede = new List <string>()
            {
                "4"
                , "5"
                , "7"
                , "8"
                , "33"
                , "42"
                , "43"
                , "44"
                , "49"
                , "51"
                , "52"
                , "61"
                , "67"
                , "297"
                , "301"
                , "564"
                , "720"
                , "721"
                , "1002"
            };
        }
Exemplo n.º 3
0
        public ActionResult Get()
        {
            var dicRegime = RegimeContext.ProfessorRegime.ToDictionary(x => x.CpfProfessor.ToString());

            List <string> listaForaSede = new List <string>()
            {
                "4"
                , "5"
                , "7"
                , "8"
                , "33"
                , "42"
                , "43"
                , "44"
                , "49"
                , "51"
                , "52"
                , "61"
                , "67"
                , "297"
                , "301"
                , "564"
                , "720"
                , "721"
                , "1002"
            };

            var campProfessor = CampusProfessor.getCampusProfessor(this.Configuration);

            var results = ForaDeSedePr.OtimizaProfessorForaDeSede(ProfessorIESContext.ProfessorIES, dicProfessorCampus)
                          .Select(p => new
            {
                CpfProfessor = p.CpfProfessor,
                NomProfessor = p.NomProfessor,
                ativo        = p.ativo,
                regime       = dicRegime.ContainsKey(p.CpfProfessor.ToString()) ? dicRegime[p.CpfProfessor.ToString()].Regime : null,
                titulacao    = p.titulacao,
                campi        = campProfessor.FirstOrDefault(c => c.Key == p.CpfProfessor.ToString()).Value.ToList()
            }
                                  )
                          .ToList();

            return(Ok(results));
        }