error correction. minor error
[RRRRHHHH_Code] / ruralHouses / src / gui / BookRuralHouseGUI.java
index 705b351..7a262fc 100644 (file)
@@ -1,6 +1,7 @@
 package gui;
 
-import businessLogic.ApplicationFacadeInterface;
+import businessLogic.BookingManager;
+import businessLogic.HouseManager;
 
 import com.toedter.calendar.*;
 
@@ -56,7 +57,7 @@ public BookRuralHouseGUI()
       e.printStackTrace();
     }
   }
-  public BookRuralHouseGUI(int houseNumber,Date firstDay,Date lastDay)
+  public BookRuralHouseGUI(String houseName,Date firstDay,Date lastDay)
   {
     try
     {
@@ -65,7 +66,7 @@ public BookRuralHouseGUI()
       
       // 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;
          }
@@ -94,8 +95,8 @@ public BookRuralHouseGUI()
     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);
 
@@ -159,9 +160,9 @@ public BookRuralHouseGUI()
                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);