Given code uploaded
[RRRRHHHH_Code] / ruralHouses / src / domain / Offer.java
1 package domain;
2
3 import java.io.*;
4 //import java.util.Vector;
5 import java.util.Date;
6 import businessLogic.OfferManager;
7 import com.db4o.ObjectContainer;
8 import dataAccess.DB4oManager;
9
10 @SuppressWarnings("serial")
11 public class Offer implements Serializable {
12         
13         private int offerNumber;
14         private Date firstDay;
15         private Date lastDay;
16         private float price;
17         private Booking booking;
18         private RuralHouse ruralHouse;
19         
20         public Offer(RuralHouse ruralHouse, Date firstDay, Date lastDay, float price) {
21                   this.firstDay=firstDay;
22                   this.lastDay=lastDay;
23                   this.price=price;
24                   this.ruralHouse=ruralHouse;
25                   this.offerNumber=OfferManager.getNumber();
26         }
27
28         public RuralHouse getRuralHouse() {
29                 return this.ruralHouse;
30         }
31
32         public void setRuralHouse(RuralHouse ruralHouse) {
33                 this.ruralHouse = ruralHouse;
34         }
35
36         public int getOfferNumber() {
37                 return this.offerNumber;
38         }
39
40         public Date getFirstDay() {
41                 return this.firstDay;
42         }
43
44         public void setFirstDay(Date firstDay) {
45                 this.firstDay = firstDay;
46         }
47
48         public Date getLastDay() {
49                 return this.lastDay;
50         }
51
52         public void setLastDay(Date lastDay) {
53                 this.lastDay = lastDay;
54         }
55
56         public float getPrice() {
57                 return this.price;
58         }
59
60         public void setPrice(float price) {
61                 this.price = price;
62         }
63
64         public Booking getBooking() {
65                 return this.booking;
66         }
67
68         public void setBooking(Booking booking) {
69                 this.booking = booking;
70         }
71         
72         public Booking createBook(String bookTelephoneNumber) {
73                 Booking b=new Booking(bookTelephoneNumber, this);
74                 booking=b;
75                 return booking;                 
76         }
77 }