unification with the actual initial project. Some things are new now, but there has...
[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         
17         public Booking() {
18         }
19
20         public Booking(int bN ,String telephone, Offer offer) {
21                 
22                 this.bookingNumber = bN;
23                 this.telephone=telephone;
24                 this.offer = offer;
25                 //this.price = price;
26                 //Booking date is assigned to actual date
27                 this.bookingDate= new java.util.Date(System.currentTimeMillis());
28                 this.isPaid=false;
29         }
30         
31         public void imprimete(){
32                 System.out.println(bookingNumber);
33                 System.out.println(isPaid);
34                 System.out.println(bookingDate);
35                 System.out.println(telephone);
36                 System.out.println(offer);              
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 setTelephone(String telephone) {
64                 this.telephone = telephone;
65         }
66
67         public String getTelephone() {
68                 return this.telephone;
69         }
70         
71         public void paid() {
72                 this.isPaid = true;
73         }
74
75         public void notPaid() {
76                 this.isPaid=false;
77         }
78
79         public boolean isPaid() {
80                 return isPaid;
81         }
82         
83 }