RRRRHHHH_Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
package businessLogic; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.util.Date; import java.util.Vector; import javax.mail.MessagingException; import common.BookingInterface; import dataAccess.DB4oManager; import domain.Booking; import domain.Client; import domain.Offer; import domain.RuralHouse; import exceptions.OfferCanNotBeBooked; public final class BookingManager extends UnicastRemoteObject implements BookingInterface { /** * */ private static final long serialVersionUID = 1L; dataAccess.DB4oManager dbMngr; public BookingManager() throws RemoteException { super(); try { this.dbMngr = DB4oManager.getInstance(); } catch (Exception e) { e.printStackTrace(); } } 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(); } } public void acceptBooking(Booking b) throws RemoteException{ b.getOffer().setBooked(true); b.getOffer().getBookings().clear(); b.getOffer().getBookings().add(b); this.dbMngr.acceptBooking(b.getOffer()); try { MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill"); } catch (MessagingException e) { e.printStackTrace(); } } /** * This method creates a book with a corresponding parameters * * @param First * day, last day, house number and telephone * @return a book */ public Vector<Booking> createBooking(RuralHouse ruralHouse, Date firstDate, Date lastDate, Client client) throws OfferCanNotBeBooked,RemoteException { return dbMngr.createBooking(ruralHouse, firstDate, lastDate, client); } @Override public Vector<Booking> getOffersbookings(Offer o) throws RemoteException { return dbMngr.getOfBok(o); } } |
Commits for RRRRHHHH_CoderuralHouses/src/businessLogic/BookingManager.java
Revision | Author | Commited | Message |
---|---|---|---|
08aaf3 ... Diff | camjan | Wed 20 May, 2015 21:26:51 +0000 | Started with the separated DB with the given code |
1cf395 ... Diff | pinene | Wed 20 May, 2015 16:58:12 +0000 | Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code |
3a0296 ... Diff | pinene | Wed 20 May, 2015 16:57:47 +0000 | bookings were made to be taken from server per time they are searched |
b09f34 ... Diff | camjan | Wed 20 May, 2015 16:46:45 +0000 | Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code |
e3043c ... Diff | camjan | Wed 20 May, 2015 16:45:21 +0000 | Some bugs have been fixed |
ccac99 ... Diff | pinene | Wed 20 May, 2015 16:42:17 +0000 | Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code Conflicts: |
d30bcc ... Diff | pinene | Wed 20 May, 2015 16:32:33 +0000 | cleaning |
4bc36b ... Diff | camjan | Tue 19 May, 2015 23:23:13 +0000 | Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code Conflicts: |
fca164 ... Diff | camjan | Tue 19 May, 2015 14:51:35 +0000 | Some improvements done, owner deletion started, some bugs remain there |
4f8bcc ... | epinzolas001 | Mon 18 May, 2015 09:49:54 +0000 | Merge conflicts solutioned |