예제 #1
0
  /**
   * Select the Room entity for display allowing the user to confirm that they would like to delete
   * the entity
   */
  @RequestMapping("/confirmDeleteRoom")
  public ModelAndView confirmDeleteRoom(@RequestParam Integer roomIdKey) {
    ModelAndView mav = new ModelAndView();

    mav.addObject("room", roomDAO.findRoomByPrimaryKey(roomIdKey));
    mav.setViewName("room/deleteRoom.jsp");

    return mav;
  }
예제 #2
0
  /** Show all Roomtype entities by Room */
  @RequestMapping("/listRoomRoomtype")
  public ModelAndView listRoomRoomtype(@RequestParam Integer roomIdKey) {
    ModelAndView mav = new ModelAndView();

    mav.addObject("room", roomDAO.findRoomByPrimaryKey(roomIdKey));
    mav.setViewName("room/roomtype/listRoomtype.jsp");

    return mav;
  }
예제 #3
0
  /** Edit an existing Room entity */
  @RequestMapping("/editRoom")
  public ModelAndView editRoom(@RequestParam Integer roomIdKey) {
    ModelAndView mav = new ModelAndView();
    Map<Integer, String> roomTypeList = new LinkedHashMap<Integer, String>();
    Set<Roomtype> roomTypeSet = roomtypeDAO.findAllRoomtypes();
    Room r = roomDAO.findRoomByPrimaryKey(roomIdKey);
    roomTypeList.put(r.getRoomtype().getRoomTypeId(), r.getRoomtype().getRoomTypeCode());
    for (Roomtype rT : roomTypeSet) {
      if (rT.getRoomTypeId() == r.getRoomtype().getRoomTypeId()) {
        continue;
      }
      roomTypeList.put(rT.getRoomTypeId(), rT.getRoomTypeCode());
    }
    mav.addObject("room", r);
    mav.addObject("roomTypeList", roomTypeList);
    mav.setViewName("room/editRoom.jsp");

    return mav;
  }
예제 #4
0
 /** Delete an existing Room entity */
 @RequestMapping("/deleteRoom")
 public String deleteRoom(@RequestParam Integer roomIdKey) {
   Room room = roomDAO.findRoomByPrimaryKey(roomIdKey);
   roomService.deleteRoom(room);
   return "forward:/indexRoom";
 }