Search in sources :

Example 26 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class TeachingDocumentsServiceSimpleImpl method findAllDisciplinasByPUD.

@Override
@Transactional(readOnly = true)
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public DisciplinaDTO[] findAllDisciplinasByPUD(Long pudId) {
    DisciplinaDAO dao = factory.getDisciplinaDAO();
    DisciplinaDTO[] disciplinasArray = null;
    try {
        List<Disciplina> disciplinas = dao.findAllByPUD(pudId);
        disciplinasArray = new DisciplinaDTO[disciplinas.size()];
        for (int i = 0; i < disciplinasArray.length; i++) {
            disciplinasArray[i] = disciplinas.get(i).createDTO();
        }
    } catch (DAOException ex) {
        throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
    } catch (Exception ex) {
        throw new CoreException("Erro de sistema: " + ex.getMessage());
    }
    return disciplinasArray;
}
Also used : DAOException(com.tomasio.projects.trainning.exception.DAOException) Disciplina(com.tomasio.projects.trainning.model.Disciplina) ObjetivoDisciplina(com.tomasio.projects.trainning.model.ObjetivoDisciplina) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO) CoreException(com.tomasio.projects.trainning.exeption.CoreException) DAOException(com.tomasio.projects.trainning.exception.DAOException) Transactional(org.springframework.transaction.annotation.Transactional)

Example 27 with DisciplinaDTO

use of com.tomasio.projects.trainning.dto.DisciplinaDTO in project trainning by fernandotomasio.

the class Disciplina method createDTOMinimal.

public DisciplinaDTO createDTOMinimal() {
    DisciplinaDTO dto = new DisciplinaDTO();
    dto.setId(this.id);
    dto.setNumeroDisciplina(numeroDisciplina);
    dto.setDescricao(descricao);
    dto.setQuantidadeTemposAula(quantidadeTemposAula);
    dto.setQuantidadeTemposAvaliacao(quantidadeTemposAvaliacao);
    dto.setQuantidadeTemposTotal(quantidadeTemposAula + quantidadeTemposAvaliacao);
    dto.setNumeroGeral(numeroGeral);
    return dto;
}
Also used : DisciplinaDTO(com.tomasio.projects.trainning.dto.DisciplinaDTO)

Aggregations

DisciplinaDTO (com.tomasio.projects.trainning.dto.DisciplinaDTO)27 ObjetivoDisciplinaDTO (com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)19 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)8 Map (java.util.Map)8 RequestContext (org.springframework.webflow.execution.RequestContext)7 UnidadeDidaticaDTO (com.tomasio.projects.trainning.dto.UnidadeDidaticaDTO)6 CurriculoMinimoDTO (com.tomasio.projects.trainning.dto.CurriculoMinimoDTO)5 DisciplinaPUDForm (com.tomasio.projects.trainning.form.pud.DisciplinaPUDForm)5 DisciplinaCMForm (com.tomasio.projects.trainning.form.cm.DisciplinaCMForm)4 Collection (java.util.Collection)4 Paragraph (com.itextpdf.text.Paragraph)3 AtividadeAdministrativaDTO (com.tomasio.projects.trainning.dto.AtividadeAdministrativaDTO)3 ComplementacaoInstrucaoDTO (com.tomasio.projects.trainning.dto.ComplementacaoInstrucaoDTO)3 FlexibilidadeProgramacaoDTO (com.tomasio.projects.trainning.dto.FlexibilidadeProgramacaoDTO)3 ObjetivoUnidadeDidaticaDTO (com.tomasio.projects.trainning.dto.ObjetivoUnidadeDidaticaDTO)3 CoreException (com.tomasio.projects.trainning.exeption.CoreException)3 Chapter (com.itextpdf.text.Chapter)2 Phrase (com.itextpdf.text.Phrase)2 Section (com.itextpdf.text.Section)2