Ejemplo n.º 1
0
  @RequestMapping(method = RequestMethod.GET, params = "deleteAttendances=Y")
  public String deletCurrentAttendances(Model model, HttpServletRequest request) {
    Child child = childManager.findChild(Integer.parseInt(request.getParameter("childId")));

    model.addAttribute(
        "attendancesDeleted", attendanceManager.deleteAttendancesForCurrentTerm(child));

    return showForm(model, request);
  }
Ejemplo n.º 2
0
  @RequestMapping(method = RequestMethod.GET)
  public String showForm(Model model, HttpServletRequest request) {
    Child child = childManager.findChild(Integer.parseInt(request.getParameter("childId")));
    child.setBills(billManager.findBillsForChild(child));
    ChildEditForm form = new ChildEditForm();
    form.setChild(child);

    model.addAttribute("formObject", form);
    model.addAttribute("rooms", roomManager.findAllActive());
    model.addAttribute("typeOfAttendances", TypeOfAttendance.values());
    model.addAttribute("ethnicityList", Ethnicity.values());
    model.addAttribute("paymentList", PaymentType.values());

    return "editChild";
  }
Ejemplo n.º 3
0
  @RequestMapping(params = "action=Save", method = RequestMethod.POST)
  public String saveChild(@ModelAttribute("formObject") ChildEditForm form) {
    childManager.saveChild(form.getChildWithNewData());

    return "redirect:editChild.htm?childId=" + form.getChild().getId();
  }