Minor changes
[RRRRHHHH_Code] / ruralHouses / src / domain / Booking.java
1 package domain;
2
3 import java.io.Serializable;
4 import java.util.Date;
5
6 public class Booking implements Serializable {
7
8         /**
9          * 
10          */
11         private static final long serialVersionUID = 1L;
12         private int bookingNumber;
13         private Date bookingDate;
14         private Client client;
15         private Offer offer;
16
17         public Booking(int bN, Offer offer, Client client, Date date) {
18                 this.bookingNumber = bN;
19                 this.offer = offer;
20                 this.client = client;
21                 // Booking date is assigned to actual date
22                 this.bookingDate = date;
23         }
24
25         public Booking(int bN, Offer offer, Client client) {
26
27                 this.bookingNumber = bN;
28                 this.offer = offer;
29                 this.client = client;
30                 // Booking date is assigned to actual date
31                 this.bookingDate = new java.util.Date(System.currentTimeMillis());
32         }
33
34         public void imprimete() {
35                 System.out.println(bookingNumber);
36                 System.out.println(bookingDate);
37                 System.out.println(client.toString());
38                 System.out.println(offer);
39         }
40
41         public int getBookNumber() {
42                 return this.bookingNumber;
43         }
44
45         public void setOffer(Offer offer) {
46                 this.offer = offer;
47         }
48
49         public Offer getOffer() {
50                 return this.offer;
51         }
52
53         public float getPrice() {
54                 return this.offer.getPrice();
55         }
56
57         public void setBookDate(Date bookDate) {
58                 this.bookingDate = bookDate;
59         }
60
61         public Date getBookDate() {
62                 return this.bookingDate;
63         }
64
65         public Client getClient() {
66                 return client;
67         }
68
69         public void setClient(Client client) {
70                 this.client = client;
71         }
72
73 }