use of com.tomasio.projects.trainning.dto.AreaDTO in project trainning by fernandotomasio.
the class Area method createDTOMinimal.
public AreaDTO createDTOMinimal() {
AreaDTO dto = new AreaDTO();
dto.setId(this.id);
dto.setSigla(this.sigla);
dto.setNome(this.nome);
return dto;
}
use of com.tomasio.projects.trainning.dto.AreaDTO in project trainning by fernandotomasio.
the class PlanejamentosController method detailSolicitacao.
@RequestMapping("/detail_planejamento")
public String detailSolicitacao(Model model, WebRequest request) {
PlanejamentoDTO planejamento = planningService.findPlanejamento(Long.parseLong(request.getParameter("planejamentoId")));
CursoDTO[] cursos = trainningService.findAllCursos(null, null, null, null);
AreaDTO[] areas = trainningService.findAllAreas();
OrganizacaoDTO[] organizacoes = organizationalService.findAllOrganizacoes();
model.addAttribute("planejamento", planejamento);
model.addAttribute("areas", areas);
model.addAttribute("organizacoes", organizacoes);
model.addAttribute("cursos", cursos);
return "detail_planejamento";
}
use of com.tomasio.projects.trainning.dto.AreaDTO in project trainning by fernandotomasio.
the class CommonsController method getAreaData.
public Map<Object, Object> getAreaData(SelectAreaForm form) {
Map<Object, Object> result = new HashMap<>();
AreaDTO area = trainningService.findArea(form.getAreaId());
result.put("nome", area.getNome());
result.put("id", area.getId());
return result;
}
use of com.tomasio.projects.trainning.dto.AreaDTO in project trainning by fernandotomasio.
the class TrainningServiceSimpleImpl method findAllAreas.
@Override
@Transactional(readOnly = true)
public AreaDTO[] findAllAreas() {
AreaDAO dao = factory.getAreaDAO();
AreaDTO[] areasArray = null;
try {
List<Area> areas = dao.findAll();
if (areas != null) {
areasArray = new AreaDTO[areas.size()];
for (int i = 0; i < areas.size(); i++) {
areasArray[i] = areas.get(i).createDTO();
}
}
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
}
return areasArray;
}
use of com.tomasio.projects.trainning.dto.AreaDTO 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";
}
Aggregations