Exemple #1
0
  @Transactional
  public Result remove() {
    //
    DynamicForm requestData = Form.form().bindFromRequest();
    String id = requestData.get("id");

    planService.remove(id);

    return redirect(routes.PlanApp.index());
  }
Exemple #2
0
  @Transactional
  public Result register() {
    //
    Form<Plan> planForm = Form.form(Plan.class).bindFromRequest();

    if (planForm.hasErrors()) {
      Logger.debug(planForm.errorsAsJson().toString());
      return badRequest();
    }

    Plan plan = planForm.get();
    planService.register(plan);

    return redirect(routes.PlanApp.index());
  }