Given code uploaded
[RRRRHHHH_Code] / ruralHouses / src / domain / Booking.java
1 package domain;
2
3 import java.io.*;
4 import java.util.Date;
5
6 import businessLogic.BookingManager;
7
8 @SuppressWarnings("serial")
9 public class Booking implements Serializable {
10         private int bookingNumber;
11         private boolean isPaid;
12         private Date bookingDate;
13         private String telephone;
14         private Offer offer;
15         
16         public Booking() {
17         }
18
19         public Booking(String telephone, Offer offer) {
20                 
21                 this.bookingNumber = BookingManager.getNumber();
22                 this.telephone=telephone;
23                 this.offer = offer;
24                 //this.price = price;
25                 //Booking date is assigned to actual date
26                 this.bookingDate= new java.util.Date(System.currentTimeMillis());
27                 this.isPaid=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(telephone);
35                 System.out.println(offer);              
36         }
37
38         public int getBookNumber() {
39                 return this.bookingNumber;
40         }
41
42         public void setOffer(Offer offer) {
43                 this.offer = offer;
44         }
45
46         public Offer getOffer() {
47                 return this.offer;
48         }
49
50         public float getPrice() {
51                 return this.offer.getPrice();
52         }
53         
54         public void setBookDate(Date bookDate) {
55                 this.bookingDate = bookDate;
56         }
57
58         public Date getBookDate() {
59                 return this.bookingDate;
60         }
61         
62         public void setTelephone(String telephone) {
63                 this.telephone = telephone;
64         }
65
66         public String getTelephone() {
67                 return this.telephone;
68         }
69         
70         public void paid() {
71                 this.isPaid = true;
72         }
73
74         public void notPaid() {
75                 this.isPaid=false;
76         }
77
78         public boolean isPaid() {
79                 return isPaid;
80         }
81         
82 }