Examples of Booking


Examples of it.hotel.model.booking.Booking

  
   public void testGetAllCompletedBooking (){
    

    
     Booking book = (Booking) bookingRawManager.get(b2.getId());
     ConfirmedBooking confirmedBooking2= bookingRawManager.checkIn(book);
     bookingRawManager.checkOut(confirmedBooking2.getId());
    

     List<Booking> existingBookings = (List<Booking>) bookingRawManager.getAllCompletedBookings();
View Full Code Here

Examples of it.hotel.model.booking.Booking

  }

 
  private void createBookings(){
   
    booking1 = new Booking();
    booking1.setBeginDate(CalendarUtils.nexDay(CalendarUtils.GetToday()));
    booking1.setFinishDate(CalendarUtils.GetToday());
    booking1.setId(1);
    booking1.setRoom(room);
   
    booking2 = new Booking();
    booking2.setBeginDate(CalendarUtils.beforeDay((CalendarUtils.GetToday())));
    booking2.setFinishDate(CalendarUtils.nexDay(CalendarUtils.GetToday()));
    booking2.setRoom(room);
   
  }
View Full Code Here

Examples of it.hotel.model.booking.Booking

       
   }
  
   public void testGetConfirmedBooking(){
    
     Booking b = (Booking) bookingRawManager.get(bf.getId());
     confirmedBooking1= bookingRawManager.checkIn(b);
     ConfirmedBooking existingBookings = bookingRawManager.getConfirmedBooking(confirmedBooking1.getId());
     assertEquals(confirmedBooking1, existingBookings);
   }
View Full Code Here

Examples of it.hotel.model.booking.Booking

    public void testEnableBooking(){
     
     
      UnconfirmedBooking booking1 = new UnconfirmedBooking(b2);
     
      Booking booking2 = bookingRawManager.enableBooking(booking1);
     
      assertEquals(booking2.getType(), "BOOKING")
     
    }
View Full Code Here

Examples of it.hotel.model.booking.Booking

   
   
    public void setBooking(){

   
    b = new Booking();
    b.setCustomer(c);
    b.setStructure(hotel2);
    b.setRoom(r);
    b.setBeginDate(CalendarUtils.GetGregorianCalendar("11/02/2009"));
    b.setFinishDate(CalendarUtils.GetGregorianCalendar("14/02/2009"));
    b.setAccomodation("PN");
    b.setType("BOOKING");
    bookingRawManager.add(b);
   
    b2 = new Booking()// confirmedBooking
    b2.setCustomer(c);
    b2.setStructure(hotel2);
    b2.setRoom(r);
    b2.setBeginDate(CalendarUtils.GetToday());
    b2.setFinishDate(CalendarUtils.GetToday());
    b2.setAccomodation("PN");
    b2.setType("BOOKING");
    bookingRawManager.add(b2);
   
   
    bc = new Booking()// confirmedBooking
    bc.setCustomer(c);
    bc.setStructure(hotel2);
    bc.setRoom(r);
    bc.setBeginDate(CalendarUtils.GetToday());
    bc.setFinishDate(CalendarUtils.GetToday());
    bc.setAccomodation("PN");
    bc.setType("BOOKING");
    bookingRawManager.add(bc);
    Booking b = (Booking) bookingRawManager.get(bc.getId());
    confirmedBooking= bookingRawManager.checkIn(b);
   
    bf = new Booking()
    bf.setCustomer(c1);
    bf.setStructure(hotel2);
    bf.setRoom(r1);
    bf.setBeginDate(CalendarUtils.GetToday());
    bf.setFinishDate(CalendarUtils.GetToday());
 
    bf.setAccomodation("PN");
    bf.setType("BOOKING");
    bookingRawManager.add(bf)
   
   
    //setBooking1
    b3 = new Booking();
    b3.setCustomer(c);
    b3.setStructure(hotel2);
    b3.setRoom(r2);
    b3.setBeginDate(CalendarUtils.GetGregorianCalendar("15/12/2010"));
    b3.setFinishDate(CalendarUtils.GetGregorianCalendar("31/12/2010"));
    b3.setAccomodation("PN");
    b3.setType("BOOKING");
    bookingRawManager.add(b3);
   
    //setBooking2 (completed booking)
    b4 = new Booking();
    b4.setCustomer(c);
    b4.setStructure(hotel2);
    b4.setRoom(r);
    b4.setBeginDate(CalendarUtils.GetToday());
    b4.setFinishDate(CalendarUtils.GetToday());
    b4.setAccomodation("PN");
    b4.setType("BOOKING");
    bookingRawManager.add(b4);
    Booking bk = (Booking) bookingRawManager.get(b4.getId());
    confirmedBooking1 = bookingRawManager.checkIn(bk);
    completedBooking = bookingRawManager.checkOut(confirmedBooking1.getId());
   
   
   
View Full Code Here

Examples of it.hotel.model.booking.Booking

   
  }
 
  public void setBookings() {
   
    book1 = new Booking();
    book1.setCustomer(customer);
    book1.setStructure(hotel1);
    book1.setRoom(room1);
    book1.setBeginDate(CalendarUtils.GetGregorianCalendar("11/02/2009"));
    book1.setFinishDate(CalendarUtils.GetGregorianCalendar("14/02/2009"));
    book1.setAccomodation("PN");
    book1.setType("BOOKING");
    bookingRawManager.add(book1);
   
    book2 = new Booking()
    book2.setCustomer(customer);
    book2.setStructure(hotel1);
    book2.setRoom(room2);
    book2.setBeginDate(CalendarUtils.GetToday());
    book2.setFinishDate(CalendarUtils.GetToday());
    book2.setAccomodation("PN");
    book2.setType("BOOKING");
    bookingRawManager.add(book2);
   
   
    book3 = new Booking()// confirmedBooking
    book3.setCustomer(customer);
    book3.setStructure(hotel1);
    book3.setRoom(room3);
    book3.setBeginDate(CalendarUtils.GetToday());
    book3.setFinishDate(CalendarUtils.GetToday());
    book3.setAccomodation("PN");
    book3.setType("BOOKING");
    bookingRawManager.add(book3);
    Booking b = (Booking) bookingRawManager.get(book3.getId());
    confirmedBooking= bookingRawManager.checkIn(b);
 
    book4 = new Booking();
    book4.setCustomer(customer);
    book4.setStructure(hotel1);
    book4.setRoom(room4);
    book4.setBeginDate(CalendarUtils.GetToday());
    book4.setFinishDate(CalendarUtils.GetTomorrow());
    book4.setAccomodation("PN");
    book4.setType("BOOKING");
    bookingRawManager.add(book4);
   
   
    book5 = new Booking();
    book5.setCustomer(customer);
    book5.setStructure(hotel1);
    book5.setRoom(room6);
    book5.setBeginDate(CalendarUtils.GetGregorianCalendar("27/09/2008"));
    book5.setFinishDate(CalendarUtils.GetToday());
    book5.setAccomodation("PN");
    book5.setType("BOOKING");
    bookingRawManager.add(book5);
   
   
    book6 = new Booking();
    book6.setCustomer(customer);
    book6.setStructure(hotel1);
    book6.setRoom(room5);
    book6.setBeginDate(CalendarUtils.GetGregorianCalendar("27/09/2008"));
    book6.setFinishDate(CalendarUtils.GetGregorianCalendar("29/09/2008"));
View Full Code Here

Examples of it.hotel.model.booking.Booking

    return customer;
  }

  private Map performPageTwo(Object command) {
    Booking booking = (Booking) command;
    String combinazioneId= booking.getCombinationId();
    Map roomsByTypology = bookingManager.getRoomsByCombination(combinazioneId, booking.getBeginDate(), booking.getFinishDate(), booking.getStructure());
    return roomsByTypology;
  }
View Full Code Here

Examples of it.hotel.model.booking.Booking

    Map roomsByTypology = bookingManager.getRoomsByCombination(combinazioneId, booking.getBeginDate(), booking.getFinishDate(), booking.getStructure());
    return roomsByTypology;
  }

  private void setProperties(Object command){
    Booking booking = (Booking)command;
    if(booking.getStructure().getId() != 0){
      booking.setStructure( (Structure) structureManager.get(booking.getStructure().getId()));
    }
 
  }
View Full Code Here

Examples of it.hotel.model.booking.Booking

    String begindate = CalendarUtils.GetDateAsString(booking.getBeginDate());
    String finishdate = CalendarUtils.GetDateAsString(booking.getFinishDate());
    String code= booking.getStructure().getId() +booking.getName()+ booking.getSurname()+begindate+finishdate;
    customerManager.add(booking.getCustomer());
    for(Room room : booking.getRoomsToBooking()){
      Booking bookingSingleRoom = new UnconfirmedBooking();
      bookingSingleRoom.setAccomodation(booking.getAccomodation());
      bookingSingleRoom.setBeginDate(booking.getBeginDate());
      bookingSingleRoom.setCustomer(booking.getCustomer());
      bookingSingleRoom.setFinishDate(booking.getFinishDate());
      bookingSingleRoom.setStructure(booking.getStructure());
      bookingSingleRoom.setRoom(room);
      bookingSingleRoom.setCode(code);
      bookingManager.add(bookingSingleRoom);
      try {
        ArrayList<Booking> bookings = (ArrayList<Booking>)bookingManager.searchByExample(bookingSingleRoom);
        req.setAttribute("booking", bookings.get(0));
        mail.sendMailHotel(bookingSingleRoom);
        mail.sendMailCustomer(bookingSingleRoom);
      } catch (MailException e) {
        System.out.println(e.getMessage());
        bookingManager.remove(bookingSingleRoom.getId());
        throw e;
      }
   
     
    }
View Full Code Here

Examples of it.hotel.model.booking.Booking

   
  }
 
  public void testConfirmedBooking() throws Exception {
   
    Booking b = (Booking) bookingRawManager.get(b2.getId());
    assertNotNull(b);
     ConfirmedBooking confirmed= bookingRawManager.checkIn(b);
     assertNotNull(confirmed);
    
     confirmed.addServices(s);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.