X-Git-Url: https://xp-dev.com/git/RRRRHHHH_Code/blobdiff_plain/c92b616b1406bb5ff52624836f0608e8c5062451..4bc36b7ddf2a9626f60c551cf999ec24052087cc:/ruralHouses/src/businessLogic/BookingManager.java diff --git a/ruralHouses/src/businessLogic/BookingManager.java b/ruralHouses/src/businessLogic/BookingManager.java index 601eb3a..f0d0a54 100644 --- a/ruralHouses/src/businessLogic/BookingManager.java +++ b/ruralHouses/src/businessLogic/BookingManager.java @@ -5,6 +5,8 @@ import java.rmi.server.UnicastRemoteObject; import java.util.Date; import java.util.Vector; +import javax.mail.MessagingException; + import com.db4o.ObjectContainer; import com.db4o.ObjectSet; import common.BookingInterface; @@ -71,25 +73,21 @@ public final class BookingManager extends UnicastRemoteObject implements Booking return theBookingManager; } - public void removeDenyBooking(Booking b) throws RemoteException{ - b.getOffer().getBookings().remove(b); + public void denyBooking(Booking b) throws RemoteException{ this.dbMngr.removeBooking(b); } public void acceptBooking(Booking b) throws RemoteException{ b.getOffer().setBooked(true); - for(Booking boo : b.getOffer().getBookings()){ - if(!boo.equals(b)) - b.getOffer().getBookings().remove(b); - } + b.getOffer().getBookings().clear(); + b.getOffer().getBookings().add(b); this.dbMngr.acceptBooking(b.getOffer()); - /*try { + try { MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill"); } catch (MessagingException e) { - // TODO Auto-generated catch block e.printStackTrace(); - }*/ + } } /**