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

    planService.remove(id);

    return redirect(routes.PlanApp.index());
  }
Exemplo n.º 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());
  }
Exemplo n.º 3
0
  public Result index() {
    Form<Plan> planForm = new Form<Plan>(Plan.class);

    List<Plan> plans = planService.findAll();
    return ok(list.render(plans, planForm));
  }