Search in sources :

Example 1 with PlanoForm

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

the class PlanosController method editPlano.

@RequestMapping("/edit")
public String editPlano(Model model, WebRequest request) {
    String planoId = request.getParameter("planoId");
    PlanoDTO dto = trainningService.findPlano(Long.parseLong(planoId));
    PlanoForm planoForm = new PlanoForm();
    planoForm.setId(dto.getId());
    planoForm.setSigla(dto.getSigla());
    planoForm.setDescricao(dto.getDescricao());
    planoForm.setDiasIndicacaoInicio(dto.getDiasIndicacaoInicio());
    planoForm.setDiasIndicacaoTermino(dto.getDiasIndicacaoTermino());
    planoForm.setOrganizacaoId(dto.getOMResponsavelId());
    model.addAttribute("OMs", initializeSelectableOMs());
    model.addAttribute("formPlano", planoForm);
    return "plano_cadastro/form";
}
Also used : PlanoForm(com.tomasio.projects.trainning.form.PlanoForm) PlanoDTO(com.tomasio.projects.trainning.dto.PlanoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with PlanoForm

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

the class PlanosController method newPlano.

@RequestMapping("/new")
public String newPlano(Model model, WebRequest request) {
    PlanoForm planoForm = new PlanoForm();
    model.addAttribute("OMs", initializeSelectableOMs());
    model.addAttribute("formPlano", planoForm);
    return "plano_cadastro/form";
}
Also used : PlanoForm(com.tomasio.projects.trainning.form.PlanoForm) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

PlanoForm (com.tomasio.projects.trainning.form.PlanoForm)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 PlanoDTO (com.tomasio.projects.trainning.dto.PlanoDTO)1