Package it.hotel.model.booking

Examples of it.hotel.model.booking.Booking


   */
  @Override
 
  public ModelAndView handleRequest(HttpServletRequest req,
      HttpServletResponse res) throws Exception {
    Booking booking=null;
   
    String idString = req.getParameter("id");
    int id=0;
    ArrayList<Booking> list= (ArrayList<Booking>) bookingManager.getAll();
    for(int i=0; i<list.size();i++){
     
      if(list.get(i).getType().compareTo("UNCONFIRMED")==0){
      if(list.get(i).getCode().compareTo(idString)==0)
      {
      id=list.get(i).getId();
      UnconfirmedBooking unconfirmed= (UnconfirmedBooking) bookingManager.get(id);
       booking= new Booking(unconfirmed);
      bookingManager.add(booking);
      bookingManager.remove(id);
   
      mail.sendMailPagamentoHotel(booking);
      mail.sendMailPagamentoCustomer(booking);
View Full Code Here


  }



  private void setupExpectedBookings() {
     booking = new Booking();
       booking.setId(1);
     
       booking.setBeginDate(CalendarUtils.GetToday());
       booking.setFinishDate(CalendarUtils.GetTomorrow());
       Booking booking2 = new Booking();
       booking2.setId(2);
       booking2.setBeginDate(CalendarUtils.GetToday());
       booking2.setFinishDate(CalendarUtils.GetTomorrow());
       Booking booking3 = new Booking();
       booking3.setId(3);
       booking3.setBeginDate(CalendarUtils.GetToday());
       booking3.setFinishDate(CalendarUtils.GetTomorrow());
       expectedBookings.add(booking);
       expectedBookings.add(booking2);
       expectedBookings.add(booking3);
  }
View Full Code Here

    
   }
 
   public void testCheckOut(){
    
     Booking book = (Booking) bookingRawManager.get(b2.getId());
     ConfirmedBooking confirmedBooking2= bookingRawManager.checkIn(book);
     bookingRawManager.checkOut(confirmedBooking2.getId());
     List<Booking> existingBookings1=(List<Booking>) bookingRawManager.getAllCompletedBookings();
     assertTrue(existingBookings1.size()==2);
         
View Full Code Here

  
   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

  }

 
  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

       
   }
  
   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

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

   
   
    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

   
  }
 
  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

    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

TOP

Related Classes of it.hotel.model.booking.Booking

Copyright © 2018 www.massapicom. 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.