Search in sources :

Example 1 with DesligamentoForm

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

the class TurmasEfetivasController method desliga.

@RequestMapping("/desligamento")
public String desliga(Model model, WebRequest request) {
    String tipo = (String) request.getParameter("tipo");
    DesligamentoForm form = new DesligamentoForm();
    if (tipo.equals("Aluno")) {
        MatriculaAlunoDTO dto = (MatriculaAlunoDTO) atividadesEnsinoService.findMatricula(Long.parseLong(request.getParameter("matriculaId")));
        model.addAttribute("pessoa", organizationalService.findPessoa(dto.getPessoa().getId()));
    } else {
        MatriculaInstrutorDTO dto = (MatriculaInstrutorDTO) atividadesEnsinoService.findMatricula(Long.parseLong(request.getParameter("matriculaId")));
        model.addAttribute("pessoa", organizationalService.findPessoa(dto.getPessoa().getId()));
    }
    Long id = Long.parseLong(request.getParameter("matriculaId"));
    form.setMatriculaId(id);
    model.addAttribute(form);
    return "turmas_efetivas/form_desligamento";
}
Also used : PreMatriculaAlunoDTO(com.tomasio.projects.trainning.dto.PreMatriculaAlunoDTO) MatriculaAlunoDTO(com.tomasio.projects.trainning.dto.MatriculaAlunoDTO) DesligamentoForm(com.tomasio.projects.trainning.form.DesligamentoForm) PreMatriculaInstrutorDTO(com.tomasio.projects.trainning.dto.PreMatriculaInstrutorDTO) MatriculaInstrutorDTO(com.tomasio.projects.trainning.dto.MatriculaInstrutorDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MatriculaAlunoDTO (com.tomasio.projects.trainning.dto.MatriculaAlunoDTO)1 MatriculaInstrutorDTO (com.tomasio.projects.trainning.dto.MatriculaInstrutorDTO)1 PreMatriculaAlunoDTO (com.tomasio.projects.trainning.dto.PreMatriculaAlunoDTO)1 PreMatriculaInstrutorDTO (com.tomasio.projects.trainning.dto.PreMatriculaInstrutorDTO)1 DesligamentoForm (com.tomasio.projects.trainning.form.DesligamentoForm)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1