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