RRRRHHHH_Code
Diff Revisions
e16868 ...
vs
95c4ff ...
for ruralHouses/src/businessLogic/OfferManager.java
|
@@ -70,5 +70,19 @@ |
70 |
70 |
|
return null; |
71 |
71 |
|
} |
72 |
72 |
|
|
73 |
|
- |
|
|
73 |
+ |
public Offer modifyOffer(RuralHouse ruralHouse, Date firstDay, Date lastDay, |
|
74 |
+ |
float price, Offer offer) throws OverlappingOfferExists, BadDates, RemoteException, Exception { |
|
75 |
+ |
if (firstDay.compareTo(lastDay)>=0) throw new BadDates(); |
|
76 |
+ |
offer.setFirstDay(firstDay); |
|
77 |
+ |
offer.setLastDay(lastDay); |
|
78 |
+ |
offer.setPrice(price); |
|
79 |
+ |
|
|
80 |
+ |
return dbMngr.modifyOffer(offer); |
|
81 |
+ |
|
|
82 |
+ |
} |
|
83 |
+ |
public void deleteOffer(RuralHouse rh, Offer o) throws RemoteException, Exception{ |
|
84 |
+ |
rh.offers.removeElement(o); |
|
85 |
+ |
dbMngr.deleteOffer(rh, o); |
|
86 |
+ |
} |
|
87 |
+ |
|
74 |
88 |
|
} |