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