RRRRHHHH_Code
Diff Revisions
d30bcc ...
vs
ccac99 ...
for ruralHouses/src/businessLogic/BookingManager.java
|
@@ -5,6 +5,8 @@ |
5 |
5 |
|
import java.util.Date; |
6 |
6 |
|
import java.util.Vector; |
7 |
7 |
|
|
|
8 |
+ |
import javax.mail.MessagingException; |
|
9 |
+ |
|
8 |
10 |
|
import com.db4o.ObjectContainer; |
9 |
11 |
|
import com.db4o.ObjectSet; |
10 |
12 |
|
import common.BookingInterface; |
|
@@ -37,25 +39,21 @@ |
37 |
39 |
|
|
38 |
40 |
|
|
39 |
41 |
|
|
40 |
|
- |
public void removeDenyBooking(Booking b) throws RemoteException{ |
41 |
|
- |
b.getOffer().getBookings().remove(b); |
|
42 |
+ |
public void denyBooking(Booking b) throws RemoteException{ |
42 |
43 |
|
this.dbMngr.removeBooking(b); |
43 |
44 |
|
} |
44 |
45 |
|
|
45 |
46 |
|
|
46 |
47 |
|
public void acceptBooking(Booking b) throws RemoteException{ |
47 |
48 |
|
b.getOffer().setBooked(true); |
48 |
|
- |
for(Booking boo : b.getOffer().getBookings()){ |
49 |
|
- |
if(!boo.equals(b)) |
50 |
|
- |
b.getOffer().getBookings().remove(b); |
51 |
|
- |
} |
|
49 |
+ |
b.getOffer().getBookings().clear(); |
|
50 |
+ |
b.getOffer().getBookings().add(b); |
52 |
51 |
|
this.dbMngr.acceptBooking(b.getOffer()); |
53 |
|
- |
/*try { |
|
52 |
+ |
try { |
54 |
53 |
|
MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill"); |
55 |
54 |
|
} catch (MessagingException e) { |
56 |
|
- |
// TODO Auto-generated catch block |
57 |
55 |
|
e.printStackTrace(); |
58 |
|
- |
}*/ |
|
56 |
+ |
} |
59 |
57 |
|
|
60 |
58 |
|
} |
61 |
59 |
|
/** |