package eja.controllers;
import eja.ejb.crates.BookingParametersCrate;
import eja.ejb.dao.BookingDao;
import eja.ejb.dao.BookingProcessDao;
import eja.ejb.entities.Booking;
import eja.ejb.entities.Customer;
import eja.ejb.entities.Hotel;
import java.util.Collection;
import java.util.Date;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
/**
*
* @author fero
*/
@ManagedBean
@SessionScoped
public class BookingProcessController {
@EJB
private BookingProcessDao _bookingProcessDao;
private int id;
private Customer customer;
private Hotel hotel;
private String bookingNo;
private Date dateFrom;
private Date dateTo;
private int price;
private String persons;
private boolean canceled;
private boolean closed;
private boolean confirmed;
public String step1() {
this._bookingProcessDao.setCustomerToBooking(this.customer);
return "booking-create-step2";
}
public String step2() {
this._bookingProcessDao.setHotelToBooking(this.hotel);
return "booking-create-step3";
}
public String step3() {
BookingParametersCrate params = new BookingParametersCrate();
params.bookingNo = this.bookingNo;
params.dateFrom = this.dateFrom;
params.dateTo = this.dateTo;
params.persons = this.persons;
params.price = this.price;
this._bookingProcessDao.setBookingParamsAndSave(params);
return "booking-list";
}
// Getters & Setters
public String getBookingNo() {
return bookingNo;
}
public void setBookingNo(String bookingNo) {
this.bookingNo = bookingNo;
}
public boolean isCanceled() {
return canceled;
}
public void setCanceled(boolean canceled) {
this.canceled = canceled;
}
public boolean isClosed() {
return closed;
}
public void setClosed(boolean closed) {
this.closed = closed;
}
public boolean isConfirmed() {
return confirmed;
}
public void setConfirmed(boolean confirmed) {
this.confirmed = confirmed;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Date getDateFrom() {
return dateFrom;
}
public void setDateFrom(Date dateFrom) {
this.dateFrom = dateFrom;
}
public Date getDateTo() {
return dateTo;
}
public void setDateTo(Date dateTo) {
this.dateTo = dateTo;
}
public Hotel getHotel() {
return hotel;
}
public void setHotel(Hotel hotel) {
this.hotel = hotel;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPersons() {
return persons;
}
public void setPersons(String persons) {
this.persons = persons;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
}