예제 #1
0
 protected void initModel(String page, HttpServletRequest request) throws SQLException {
   GosReservationMgr gosReservationMgr = new GosReservationMgr();
   this.putManagerToSession(request, gosReservationMgr);
   if (page.equals("reservation")) {
     gosReservationMgr.setEntryMode(Constant.RESERVATION);
     //        	gosReservationMgr.getCurrentReservation().refreshUnitList();
     gosReservationMgr.getReservationMeta().refreshReservationList();
     this.setHttpRequestReservation(request, gosReservationMgr);
   } else if (page.equals("reservationList")) {
     gosReservationMgr.setEntryMode(Constant.RESERVATION_LIST);
     //        	gosReservationMgr.getCurrentReservation().refreshUnitList();
     gosReservationMgr.getReservationMeta().refreshReservationList();
     this.setHttpRequestReservation(request, gosReservationMgr);
   }
 }
예제 #2
0
  protected void processSelectModel(
      String actionCode, String actionObject, HttpServletRequest request) throws SQLException {

    GosReservationMgr gosReservationMgr = (GosReservationMgr) this.getManagerFromSession(request);
    String key = actionCode.split("-")[2];

    if (actionObject.equals("reservation")) {
      setHttpRequestReservation(request, gosReservationMgr);
      gosReservationMgr.getCurrentReservation().validate();
      System.out.println(
          "gosReservationMgr.getCurrentReservation().isValid() : "
              + gosReservationMgr.getCurrentReservation().isValid());
      if (gosReservationMgr.getCurrentReservation().isValid()) {
        gosReservationMgr.getCurrentReservation().save();
        if (gosReservationMgr.getCurrentReservation().isValid()
            && !gosReservationMgr.getFunctionMode().equals(Constant.EDIT)) {
          ((LinkedList) gosReservationMgr.getReservationMeta().getReservationList())
              .addFirst(gosReservationMgr.getCurrentReservation());
        }
      }
    }
  }