Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code
authorcamjan <jcampos004@ikasle.ehu.es>
Wed, 20 May 2015 16:46:45 +0000 (18:46 +0200)
committercamjan <jcampos004@ikasle.ehu.es>
Wed, 20 May 2015 16:46:45 +0000 (18:46 +0200)
1  2 
ruralHouses/src/businessLogic/BookingManager.java

@@@ -25,10 -25,8 +25,8 @@@ public final class BookingManager exten
         * 
         */
        private static final long serialVersionUID = 1L;
-       private int bookingNumber = 0;
        dataAccess.DB4oManager dbMngr;
  
-       private static BookingManager theBookingManager;
  
        public BookingManager() throws RemoteException {
                super();
                }
        }
  
-       /**
-        * This method returns the next Booking number
-        * 
-        * @return the book number
-        */
-     public int getNumber() throws RemoteException{
-               ObjectContainer db=DB4oManager.getContainer();
-       BookingManager b=getInstance();
-       b.bookingNumber++;
-       db.store(b);
-       db.commit();
-       return b.bookingNumber;
-     }
        
-       /**
-        * This method returns the instance of the BookingManager class
-        * 
-        * @return the booking manager
-        * @throws RemoteException 
-        */
-       public BookingManager getInstance() throws RemoteException  {
-               ObjectContainer db=DB4oManager.getContainer();
-           BookingManager b = new BookingManager();
-           ObjectSet<BookingManager> result = db.queryByExample(b);
-           if (!result.hasNext()){
-               theBookingManager = new BookingManager();
-               db.store(theBookingManager);
-               db.commit();
-           } else theBookingManager=(BookingManager)result.next();
-               return theBookingManager;
-       }
  
        public void denyBooking(Booking b) throws RemoteException{
                                this.dbMngr.removeBooking(b);
 +                              try {
 +                                      MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has not been accepted","We are sorry");
 +                              } catch (MessagingException e) {
 +                                      e.printStackTrace();
 +                              }
        }