Пример #1
0
 private AuditoriaRelatorioSemestralAlunoDto MapearParaAuditorio(RelatorioSemestralPAPAluno relatorioSemestralAluno)
 => new AuditoriaRelatorioSemestralAlunoDto()
 {
     RelatorioSemestralId      = relatorioSemestralAluno.RelatorioSemestralTurmaPAPId,
     RelatorioSemestralAlunoId = relatorioSemestralAluno.Id,
     Auditoria = (AuditoriaDto)relatorioSemestralAluno
 };
        private RelatorioSemestralAlunoDto ConverterParaDto(RelatorioSemestralPAPAluno relatorioAluno, RelatorioSemestralTurmaPAP relatorioTurma)
        {
            var dto = new RelatorioSemestralAlunoDto()
            {
                RelatorioSemestralAlunoId = relatorioAluno?.Id ?? 0,
                RelatorioSemestralId      = relatorioTurma?.Id ?? 0
            };

            if (relatorioAluno != null)
            {
                dto.Auditoria = (AuditoriaDto)relatorioAluno;
            }

            return(dto);
        }
Пример #3
0
        private async Task <RelatorioSemestralPAPAluno> NovoRelatorioSemestralAluno(long relatorioSemestralId, string alunoCodigo, Turma turma, int semestre, RelatorioSemestralAlunoPersistenciaDto relatorioSemestralAlunoDto)
        {
            var relatorioSemestral = relatorioSemestralId > 0 ?
                                     await consultasRelatorioSemestral.ObterPorIdAsync(relatorioSemestralId) :
                                     NovoRelatorioSemestral(turma, semestre);

            var novoRelatorioAluno = new RelatorioSemestralPAPAluno()
            {
                AlunoCodigo = alunoCodigo,
                RelatorioSemestralTurmaPAP = relatorioSemestral,
            };

            foreach (var secaoRelatorio in relatorioSemestralAlunoDto.Secoes)
            {
                novoRelatorioAluno.Secoes.Add(new RelatorioSemestralPAPAlunoSecao()
                {
                    RelatorioSemestralPAPAluno   = novoRelatorioAluno,
                    SecaoRelatorioSemestralPAPId = secaoRelatorio.Id,
                });
            }

            return(novoRelatorioAluno);
        }