Search in sources :

Example 1 with ConviteInstrutorPerfilForm

use of com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilForm in project trainning by fernandotomasio.

the class ConvitesInstrutoresController method editConviteInstrutorPerfilForm.

public ConviteInstrutorPerfilForm editConviteInstrutorPerfilForm(Long conviteId) {
    SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
    ConviteInstrutorPerfilForm form = new ConviteInstrutorPerfilForm();
    ConviteInstrutorPerfilDTO convite = (ConviteInstrutorPerfilDTO) atividadesEnsinoService.findConviteInstrutor(conviteId);
    form.setId(convite.getId());
    form.setTurmaId(convite.getTurma().getId());
    ConviteInstrutorPerfilFormStep1 formStep1 = new ConviteInstrutorPerfilFormStep1();
    ItemConviteInstrutorPerfilDTO[] itensConvite = atividadesEnsinoService.findAllItensConviteInstrutorPerfilByConviteInstrutorPerfilId(conviteId);
    List<ItemConviteInstrutorPerfilForm> formItens = new ArrayList<>();
    for (ItemConviteInstrutorPerfilDTO item : itensConvite) {
        ItemConviteInstrutorPerfilForm formItemConvite = new ItemConviteInstrutorPerfilForm();
        formItemConvite.setId(item.getId());
        ItemConviteInstrutorPerfilStep1 formItemStep1 = new ItemConviteInstrutorPerfilStep1();
        formItemStep1.setDisciplinasIds(item.getDisciplinasIds());
        formItemConvite.setStep1(formItemStep1);
        ItemConviteInstrutorPerfilStep2 formItemStep2 = new ItemConviteInstrutorPerfilStep2();
        formItemStep2.setDataInicio(item.getPeriodo().getDataInicioFormated());
        formItemStep2.setDataTermino(item.getPeriodo().getDataTerminoFormated());
        formItemStep2.setObservacao(item.getObservacao());
        formItemStep2.setQuantidade(item.getQuantidade());
        formItemConvite.setStep2(formItemStep2);
        formItens.add(formItemConvite);
    }
    formStep1.setItensDataList(formItens);
    form.setStep1(formStep1);
    ConviteInstrutorPerfilFormStep2 formStep2 = new ConviteInstrutorPerfilFormStep2();
    formStep2.setOrganizacoesIds(convite.getDestinatariosIds());
    form.setStep2(formStep2);
    ConviteInstrutorPerfilFormStep3 formStep3 = new ConviteInstrutorPerfilFormStep3();
    formStep3.setDocumento(convite.getDocumento());
    formStep3.setObservacao(convite.getObservacao());
    formStep3.setPrazo(df.format(convite.getPrazo()));
    form.setStep3(formStep3);
    return form;
}
Also used : ConviteInstrutorPerfilFormStep1(com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep1) ConviteInstrutorPerfilFormStep3(com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep3) ConviteInstrutorPerfilFormStep2(com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep2) ConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ConviteInstrutorPerfilDTO) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) ArrayList(java.util.ArrayList) ItemConviteInstrutorPerfilForm(com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilForm) ConviteInstrutorPerfilForm(com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilForm) ItemConviteInstrutorPerfilForm(com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilForm) SimpleDateFormat(java.text.SimpleDateFormat) ItemConviteInstrutorPerfilDTO(com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO) ItemConviteInstrutorPerfilStep2(com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilStep2) ItemConviteInstrutorPerfilStep1(com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilStep1)

Example 2 with ConviteInstrutorPerfilForm

use of com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilForm in project trainning by fernandotomasio.

the class ConvitesInstrutoresController method initializeConviteInstrutorPerfilForm.

public ConviteInstrutorPerfilForm initializeConviteInstrutorPerfilForm(Long turmaId) {
    ConviteInstrutorPerfilForm form = new ConviteInstrutorPerfilForm();
    form.setTurmaId(turmaId);
    return form;
}
Also used : ConviteInstrutorPerfilForm(com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilForm) ItemConviteInstrutorPerfilForm(com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilForm)

Aggregations

ConviteInstrutorPerfilForm (com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilForm)2 ItemConviteInstrutorPerfilForm (com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilForm)2 ConviteInstrutorPerfilDTO (com.tomasio.projects.trainning.dto.ConviteInstrutorPerfilDTO)1 ItemConviteInstrutorPerfilDTO (com.tomasio.projects.trainning.dto.ItemConviteInstrutorPerfilDTO)1 ConviteInstrutorPerfilFormStep1 (com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep1)1 ConviteInstrutorPerfilFormStep2 (com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep2)1 ConviteInstrutorPerfilFormStep3 (com.tomasio.projects.trainning.form.convites.ConviteInstrutorPerfilFormStep3)1 ItemConviteInstrutorPerfilStep1 (com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilStep1)1 ItemConviteInstrutorPerfilStep2 (com.tomasio.projects.trainning.form.convites.ItemConviteInstrutorPerfilStep2)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1