@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); }
@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"; }
@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(); }