Booking confirmation and e-mail service added. Some bugs to be solved.
[RRRRHHHH_Code] / ruralHouses / src / domain / Offer.java
index 00a3e70..3442a6a 100644 (file)
@@ -2,7 +2,6 @@ package domain;
 
 import java.io.Serializable;
 import java.util.Date;
-import java.util.LinkedList;
 import java.util.Vector;
 
 
@@ -13,8 +12,9 @@ public class Offer implements Serializable {
        private int offerNumber;
        private Date firstDay; // Dates are stored as java.util.Date objects instead of java.sql.Date objects
        private Date lastDay;  // because, they are not well stored in db4o as java.util.Date objects
-       private float price;   // This is coherent because objects of java.sql.Date are objects of java.util.Date 
-       private Vector<Booking> bookings;  // That is: java.sql.Date is a subclass (or extends) java.util.Date
+       private float price;   // This is coherent because objects of java.sql.Date are objects of java.util.Date รง
+       private boolean isBooked;
+       private Vector<Booking> bookings = new Vector<Booking>();  // That is: java.sql.Date is a subclass (or extends) java.util.Date
        private RuralHouse ruralHouse;
 
        
@@ -118,11 +118,10 @@ public class Offer implements Serializable {
         * @param First day, last day, house number and telephone
         * @return a book
         */
-       public Booking createBooking(int numBooking,String bookTelephoneNumber,String name , String mail) {
-               Client client = new Client(name,mail,bookTelephoneNumber);
+       public Vector<Booking> createBooking(int numBooking,Client client) {
                Booking b = new Booking(numBooking,this,client);
                this.bookings.add(b);
-               return b;
+               return this.bookings;
                        
        }
        
@@ -135,4 +134,10 @@ public class Offer implements Serializable {
        public void setBookings(Vector<Booking> bookings) {
                this.bookings = bookings;
        }
+       public boolean isBooked() {
+               return isBooked;
+       }
+       public void setBooked(boolean isBooked) {
+               this.isBooked = isBooked;
+       }
 }
\ No newline at end of file