Пример #1
0
  @RequestMapping(value = "/admin/halls/form/{hallId}")
  public String addFormHall(@PathVariable("hallId") Integer hallId, Map<String, Object> map) {
    this.setId(map);

    map.put("hall", hallService.getHall(hallId));
    return "backend/hallForm";
  }
Пример #2
0
  @RequestMapping("/admin/halls")
  public String listMovies(Map<String, Object> map) {
    this.setId(map);

    map.put("title", "Správa sálů");
    map.put("halls", hallService.list());
    return "backend/halls";
  }
Пример #3
0
  @RequestMapping("/admin/halls/delete/{hallId}")
  public String deleteHall(
      @PathVariable("hallId") Integer hallId, Locale locale, RedirectAttributes ra) {

    hallService.removeHall(hallId);

    ra.addFlashAttribute(
        "SUCCESS_MESSAGE", messageSource.getMessage("halldeletestatus", null, locale));

    return "redirect:/admin/halls";
  }
Пример #4
0
  @RequestMapping(value = "/admin/halls/udpate", method = RequestMethod.POST)
  public String updateHall(
      ModelMap model,
      @Valid @ModelAttribute("hall") Hall hall,
      BindingResult result,
      Locale locale,
      RedirectAttributes ra) {
    this.setId(model);

    if (result.hasErrors()) {
      model.put("error", "1");
      return "backend/hallForm";
    }

    hallService.updateHall(hall);
    ra.addFlashAttribute(
        "SUCCESS_MESSAGE", messageSource.getMessage("hallsavestatus", null, locale));

    return "redirect:/admin/halls";
  }