Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void saveProject(@Valid Project project, List<Task> tasks)
- {
- if (validation.hasErrors())
- {
- flash.error("ErrorSavingForm");
- render("@editProject", project, tasks);
- }
- else
- {
- project.save();
- if (tasks != null) for (int i = 1, x = tasks.size(); i < x; i++)
- {
- Task task = tasks.get(i);
- if (task == null)
- continue;
- if (task.id != null)
- {
- task = Task.findById(task.id);
- Binder.bind(task, "tasks["+i+"]", request.params.all());
- }
- task.project = project;
- task.save();
- }
- project(project.id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement