40638c7f9d0010ab18437f9db961c2673a3f1dd6
[RRRRHHHH_Code] / ruralHouses / src / domain / Booking.java
1 package domain;
2
3 import java.io.Serializable;
4 import java.util.Date;
5
6 @SuppressWarnings("serial")
7 public class Booking implements Serializable {
8         private int bookingNumber;
9         private boolean isPaid;
10         private Date bookingDate;
11         private Client client;
12         private Offer offer;
13         private boolean isAccepted;
14         
15         
16         public Booking() {
17         }
18
19         public Booking(int bN , Offer offer,Client client) {
20                 
21                 this.bookingNumber = bN;
22                 this.offer = offer;
23                 this.client=client;
24                 //Booking date is assigned to actual date
25                 this.bookingDate= new java.util.Date(System.currentTimeMillis());
26                 this.isPaid=false;
27                 this.isAccepted=false;
28         }
29         
30         public void imprimete(){
31                 System.out.println(bookingNumber);
32                 System.out.println(isPaid);
33                 System.out.println(bookingDate);
34                 System.out.println(client.toString());
35                 System.out.println(offer);              
36                 System.out.println(this.isAccepted);    
37         }
38
39         public int getBookNumber() {
40                 return this.bookingNumber;
41         }
42
43         public void setOffer(Offer offer) {
44                 this.offer = offer;
45         }
46
47         public Offer getOffer() {
48                 return this.offer;
49         }
50
51         public float getPrice() {
52                 return this.offer.getPrice();
53         }
54         
55         public void setBookDate(Date bookDate) {
56                 this.bookingDate = bookDate;
57         }
58
59         public Date getBookDate() {
60                 return this.bookingDate;
61         }
62         
63         public void paid() {
64                 this.isPaid = true;
65         }
66
67         public void notPaid() {
68                 this.isPaid=false;
69         }
70
71         public boolean isPaid() {
72                 return isPaid;
73         }
74         
75         public boolean isAccepted(){
76                 return this.isAccepted;
77         }
78
79         public Client getClient() {
80                 return client;
81         }
82
83         public void setClient(Client client) {
84                 this.client = client;
85         }
86         
87 }