Search in sources :

Example 1 with Booking

use of com.tap5.hotelbooking.entities.Booking in project tapestry5-hotel-booking by ccordenier.

the class UserWorkspace method restoreBooking.

public Booking restoreBooking(Long bookId) {
    Booking restoredBooking = null;
    for (Booking booking : notConfirmed) {
        if (bookId.equals(booking.getHotel().getId())) {
            restoredBooking = booking;
            break;
        }
    }
    this.current = restoredBooking;
    return restoredBooking;
}
Also used : Booking(com.tap5.hotelbooking.entities.Booking)

Example 2 with Booking

use of com.tap5.hotelbooking.entities.Booking in project tapestry5-hotel-booking by ccordenier.

the class UserWorkspace method startBooking.

public void startBooking(Hotel hotel, User user) {
    Booking booking = new Booking(hotel, user, 1, 1);
    this.current = booking;
    notConfirmed.add(booking);
}
Also used : Booking(com.tap5.hotelbooking.entities.Booking)

Example 3 with Booking

use of com.tap5.hotelbooking.entities.Booking in project tapestry5-hotel-booking by ccordenier.

the class View method startBooking.

/**
     * Start booking process.
     * 
     * @param hotel
     * @return link to the current hotel booking
     */
@OnEvent(value = EventConstants.SUCCESS, component = "startBookingForm")
Object startBooking(Hotel hotel) {
    User user = (User) dao.find(User.class, authenticator.getLoggedUser().getId());
    userWorkspace.startBooking(hotel, user);
    return Book.class;
}
Also used : User(com.tap5.hotelbooking.entities.User) OnEvent(org.apache.tapestry5.annotations.OnEvent)

Aggregations

Booking (com.tap5.hotelbooking.entities.Booking)2 User (com.tap5.hotelbooking.entities.User)1 OnEvent (org.apache.tapestry5.annotations.OnEvent)1