Beispiel #1
0
        private async Task <IList <SProfessorTurma> > GetProfessorTurmasAsync(string codProf, DateTime dataInicial, DateTime dataFinal)
        {
            var filtro = new List <string> {
                @"
                    SProfessorTurma.CodProf =:CODPROF AND
                    (SProfessorTurma.DtInicio BETWEEN :DATAINICIAL AND :DATAFINAL
                    OR SProfessorTurma.DtFim BETWEEN :DATAINICIAL AND :DATAFINAL)
                ",
                codProf,
                dataInicial.ToString("s"),
                dataFinal.ToString("s")
            };

            var result = await _professorTurmaData.GetAllAsync(filter : filtro);

            return(result.Data);
        }
Beispiel #2
0
        public async Task <IList <SProfessorTurma> > GetProfessoresAsync(IList <string> codigosProf, DateTime dataIncial, DateTime dataFinal)
        {
            var codigos = codigosProf.Select(c => $"'{c}'").ToList();
            var filtro  = new List <string> {
                $"SProfessorTurma.CodProf in ({string.Join(',', codigos)}) " +
                $"AND (SPROFESSORTURMA.DTINICIO BETWEEN '{dataIncial.ToString("s")}' AND '{dataFinal.ToString("s")}' " +
                $"OR SPROFESSORTURMA.DTFIM BETWEEN '{dataIncial.ToString("s")}' AND '{dataFinal.ToString("s")}')"
            };

            var result = await _professorTurmaData.GetAllAsync(filter : filtro);

            if (result == null)
            {
                return(new List <SProfessorTurma>());
            }

            return(result.Data);
        }