51546c3f75a06b89fc20a4326538ec5143eaa60f
[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         
14         
15         public Booking() {
16         }
17
18         public Booking(int bN , Offer offer,Client client) {
19                 
20                 this.bookingNumber = bN;
21                 this.offer = offer;
22                 this.client=client;
23                 //Booking date is assigned to actual date
24                 this.bookingDate= new java.util.Date(System.currentTimeMillis());
25                 this.isPaid=false;
26         }
27         
28         public void imprimete(){
29                 System.out.println(bookingNumber);
30                 System.out.println(isPaid);
31                 System.out.println(bookingDate);
32                 System.out.println(client.toString());
33                 System.out.println(offer);      
34         }
35
36         public int getBookNumber() {
37                 return this.bookingNumber;
38         }
39
40         public void setOffer(Offer offer) {
41                 this.offer = offer;
42         }
43
44         public Offer getOffer() {
45                 return this.offer;
46         }
47
48         public float getPrice() {
49                 return this.offer.getPrice();
50         }
51         
52         public void setBookDate(Date bookDate) {
53                 this.bookingDate = bookDate;
54         }
55
56         public Date getBookDate() {
57                 return this.bookingDate;
58         }
59         
60         public void paid() {
61                 this.isPaid = true;
62         }
63
64         public void notPaid() {
65                 this.isPaid=false;
66         }
67
68         public boolean isPaid() {
69                 return isPaid;
70         }
71         
72
73
74         public Client getClient() {
75                 return client;
76         }
77
78         public void setClient(Client client) {
79                 this.client = client;
80         }
81         
82 }