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;
}
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);
}
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;
}