예제 #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);
  }
예제 #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";
  }
예제 #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();
  }