Search in sources :

Example 1 with PlanejamentoForm

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

the class PlanejamentosController method editSolicitacao.

@RequestMapping("/edit_planejamento")
public String editSolicitacao(Model model, WebRequest request) {
    SimpleDateFormat df = new SimpleDateFormat("yyyy");
    PlanejamentoDTO dto = planningService.findPlanejamento(Long.parseLong(request.getParameter("planejamentoId")));
    OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
    PlanejamentoForm form = new PlanejamentoForm();
    form.setDescricao(dto.getDescricao());
    form.setId(dto.getId());
    form.setOrganizacaoId(dto.getOrganizacao().getId());
    form.setExercicio(df.format(dto.getExercicio()));
    form.setOpenned(dto.isOpenned());
    model.addAttribute(form);
    model.addAttribute("organizacoes", organizacoes);
    return "form_planejamento";
}
Also used : OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) SimpleDateFormat(java.text.SimpleDateFormat) PlanejamentoForm(com.tomasio.projects.trainning.form.PlanejamentoForm) PlanejamentoDTO(com.tomasio.projects.trainning.dto.PlanejamentoDTO) ItemPlanejamentoDTO(com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with PlanejamentoForm

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

the class PlanejamentosController method newPlanejamento.

@RequestMapping("/novo_planejamento")
public String newPlanejamento(Model model, @ModelAttribute("userOrganization") OrganizacaoDTO userOrganization, WebRequest request) {
    PlanejamentoForm form = new PlanejamentoForm();
    OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
    model.addAttribute(form);
    model.addAttribute("organizacoes", organizacoes);
    return "form_planejamento";
}
Also used : OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) PlanejamentoForm(com.tomasio.projects.trainning.form.PlanejamentoForm) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

OrganizacaoDTO (com.tomasio.projects.trainning.dto.OrganizacaoDTO)2 PlanejamentoForm (com.tomasio.projects.trainning.form.PlanejamentoForm)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ItemPlanejamentoDTO (com.tomasio.projects.trainning.dto.ItemPlanejamentoDTO)1 PlanejamentoDTO (com.tomasio.projects.trainning.dto.PlanejamentoDTO)1 SimpleDateFormat (java.text.SimpleDateFormat)1