Search in sources :

Example 1 with AreaForm

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

the class AreasController method editArea.

@RequestMapping("/edit")
public String editArea(Model model, WebRequest request) {
    String areaId = request.getParameter("areaId");
    AreaDTO[] areas = trainningService.findAllAreasExcept(Long.parseLong(areaId));
    AreaDTO dto = trainningService.findArea(Long.parseLong(areaId));
    AreaForm areaForm = new AreaForm();
    areaForm.setId(dto.getId());
    areaForm.setSigla(dto.getSigla());
    areaForm.setNome(dto.getNome());
    areaForm.setParentId(dto.getParentId());
    model.addAttribute("areas", areas);
    model.addAttribute(areaForm);
    return "areas/form";
}
Also used : AreaForm(com.tomasio.projects.trainning.form.AreaForm) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with AreaForm

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

the class AreasController method newArea.

@RequestMapping("/new")
public String newArea(Model model) {
    AreaDTO[] areas = trainningService.findAllAreas();
    AreaForm areaForm = new AreaForm();
    model.addAttribute(areaForm);
    model.addAttribute("areas", areas);
    return "areas/form";
}
Also used : AreaForm(com.tomasio.projects.trainning.form.AreaForm) AreaDTO(com.tomasio.projects.trainning.dto.AreaDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

AreaDTO (com.tomasio.projects.trainning.dto.AreaDTO)2 AreaForm (com.tomasio.projects.trainning.form.AreaForm)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2