Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions 25898b ... vs fca164 ... for ruralHouses/src/businessLogic/BookingManager.java

Diff revisions: vs.
  @@ -5,10 +5,12 @@
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 - import common.BookingInterface;
11 12
13 + import common.BookingInterface;
12 14 import dataAccess.DB4oManager;
13 15 import domain.Booking;
14 16 import domain.Client;
  @@ -71,25 +73,21 @@
71 73 return theBookingManager;
72 74 }
73 75
74 - public void removeDenyBooking(Booking b) throws RemoteException{
75 - b.getOffer().getBookings().remove(b);
76 + public void denyBooking(Booking b) throws RemoteException{
76 77 this.dbMngr.removeBooking(b);
77 78 }
78 79
79 80
80 81 public void acceptBooking(Booking b) throws RemoteException{
81 82 b.getOffer().setBooked(true);
82 - for(Booking boo : b.getOffer().getBookings()){
83 - if(!boo.equals(b))
84 - b.getOffer().getBookings().remove(b);
85 - }
83 + b.getOffer().getBookings().clear();
84 + b.getOffer().getBookings().add(b);
86 85 this.dbMngr.acceptBooking(b.getOffer());
87 - /*try {
86 + try {
88 87 MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill");
89 88 } catch (MessagingException e) {
90 - // TODO Auto-generated catch block
91 89 e.printStackTrace();
92 - }*/
90 + }
93 91
94 92 }
95 93 /**