public static ProjectDTO updateProject(ProjectDTO inputDTO) { validateProject(inputDTO); // Generate a TmpProject from the input TmpProject tmpProject = ProjectManager.generateTmpProject(inputDTO); tmpProject.setProjectId(Integer.parseInt(inputDTO.getProjectId())); tmpProject.setDateUpdated(new Date()); // Update the client tmpProjectDAO.update(tmpProject); // Return the resulting VO return ProjectManager.generateProjectDTO(tmpProject); }
public static ProjectDTO addProject(ProjectDTO inputDTO) { validateProject(inputDTO); // Generate a PathClient from the input TmpProject tmpProject = ProjectManager.generateTmpProject(inputDTO); // Set Export fields tmpProject.setDateCreated(new Date()); tmpProject.setDateUpdated(new Date()); // Save the client to allow secondary object generation tmpProjectDAO.save(tmpProject); inputDTO.setProjectId(tmpProject.getProjectId().toString()); // Return the resulting VO return ProjectManager.generateProjectDTO(tmpProject); }