Username is saved hashed and password hashed and salted
[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         private boolean isAccepted;
14         
15         
16         public Booking() {
17         }
18
19         public Booking(int bN ,String telephone, Offer offer) {
20                 
21                 this.bookingNumber = bN;
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                 this.isAccepted=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                 System.out.println(this.isAccepted);    
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 setTelephone(String telephone) {
65                 this.telephone = telephone;
66         }
67
68         public String getTelephone() {
69                 return this.telephone;
70         }
71         
72         public void paid() {
73                 this.isPaid = true;
74         }
75
76         public void notPaid() {
77                 this.isPaid=false;
78         }
79
80         public boolean isPaid() {
81                 return isPaid;
82         }
83         
84         public boolean isAccepted(){
85                 return this.isAccepted;
86         }
87         
88 }