package gui;
-import businessLogic.ApplicationFacadeInterface;
+import businessLogic.BookingManager;
+import businessLogic.HouseManager;
import com.toedter.calendar.*;
e.printStackTrace();
}
}
- public BookRuralHouseGUI(int houseNumber,Date firstDay,Date lastDay)
+ public BookRuralHouseGUI(String houseName,Date firstDay,Date lastDay)
{
try
{
// Put the "houseNumber", "firstDay" and "lastDay" in the graphical components of the user interface
for (int i=0; i<ruralHouses.size();i++){
- if (((RuralHouse)ruralHouses.get(i)).getHouseNumber()==houseNumber) {
+ if (((RuralHouse)ruralHouses.get(i)).getHouseName()==houseName) {
jComboBox1.setSelectedIndex(i);
break;
}
this.setSize(new Dimension(410, 413));
this.setTitle("Book Rural House");
jLabel1.setText("Rural house:");
- ApplicationFacadeInterface facade=StartWindow.getBusinessLogic();
- ruralHouses=facade.getAllRuralHouses();
+ HouseManager houseM = new HouseManager();
+ ruralHouses=houseM.getAllRuralHouses();
jComboBox1 = new JComboBox(ruralHouses);
try {
//Obtain the business logic from a StartWindow class (local or remote)
- ApplicationFacadeInterface facade=StartWindow.getBusinessLogic();
+ BookingManager bookingM = new BookingManager();
- Booking book=facade.createBooking(house, firstDay, lastDay, telephone);
+ Booking book=bookingM.createBooking(house, firstDay, lastDay, telephone);
if (book!=null) {
BookRuralHouseConfirmationWindow confirmWindow=new BookRuralHouseConfirmationWindow(book);
confirmWindow.setVisible(true);