Package com.liferay.faces.demos.dto

Examples of com.liferay.faces.demos.dto.Booking


    if (allBookings == null) {
      allBookings = new ArrayList<Booking>();

      // Bookings for Brian Green
      long customerId = CustomerServiceMockImpl.ID_BRIAN_GREEN;
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_RENTAL_CAR, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_HOTEL, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_AIRFARE, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_THEME_PARK, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_PLAY, customerId));

      // Bookings for Elizabeth Kessler
      customerId = CustomerServiceMockImpl.ID_LIZ_KESSLER;
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_HOTEL, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_AIRFARE, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_THEME_PARK, customerId));

      // Bookings for Rich Shearer
      customerId = CustomerServiceMockImpl.ID_RICH_SHEARER;
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_AIRFARE, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_RENTAL_CAR, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_PLAY, customerId));
      allBookings.add(new Booking(BookingTypeServiceMockImpl.TYPE_ID_HOTEL, customerId));
    }

    return allBookings;
  }
View Full Code Here


  public void removeBooking(long bookingId) {

    List<Booking> cartBookings = bookingFlowModelBean.getCartBookings();

    Booking bookingToRemove = null;

    for (Booking cartBooking : cartBookings) {

      if (cartBooking.getBookingId() == bookingId) {
        bookingToRemove = cartBooking;
View Full Code Here

    while (departureCalendar.get(Calendar.HOUR_OF_DAY) < 18) {

      Calendar arrivalCalendar = (Calendar) departureCalendar.clone();
      arrivalCalendar.add(Calendar.HOUR_OF_DAY, (int) Math.round(durationInHours));

      Booking flight = new Booking();
      Date flightDepartureDate = departureCalendar.getTime();
      flight.setDepartureDate(flightDepartureDate);
      flight.setArrivalId(arrivalAirportId);

      Date flightArrivalDate = arrivalCalendar.getTime();
      flight.setArrivalDate(flightArrivalDate);
      flight.setDistance(distanceInKilometers);
      flight.setDuration(durationInHours);
      flight.setBookingId(Math.abs(random.nextLong()));

      String flightNumber = Integer.toString(Math.abs(random.nextInt()));
      flight.setLabel(flightNumber);

      StringBuilder description = new StringBuilder();
      description.append("Flight#");
      description.append(flightNumber);
      description.append(StringPool.SPACE);
      description.append("departing from");
      description.append(StringPool.SPACE);
      description.append(departureAirport.getCity());
      description.append(StringPool.SPACE);
      description.append(StringPool.OPEN_PARENTHESIS);
      description.append(departureAirport.getCode());
      description.append(StringPool.CLOSE_PARENTHESIS);
      description.append(StringPool.SPACE);
      description.append("on");
      description.append(StringPool.SPACE);
      description.append(dateFormat.format(flightDepartureDate));
      description.append(StringPool.SPACE);
      description.append("arriving at");
      description.append(StringPool.SPACE);
      description.append(arrivalAirport.getCity());
      description.append(StringPool.OPEN_PARENTHESIS);
      description.append(arrivalAirport.getCode());
      description.append(StringPool.CLOSE_PARENTHESIS);
      description.append(StringPool.SPACE);
      description.append("on");
      description.append(StringPool.SPACE);
      description.append(dateFormat.format(flightArrivalDate));
      flight.setDescription(description.toString());

      BigDecimal price = new BigDecimal(priceUSD);
      price.setScale(2, BigDecimal.ROUND_HALF_UP);
      flight.setPrice(price);
      departureCalendar.add(Calendar.MINUTE, 90);

      searchResults.add(flight);
    }
View Full Code Here

TOP

Related Classes of com.liferay.faces.demos.dto.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.