Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
08aaf3b19060c67249a3f3e206690c260e881713
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

Diff revisions: vs.
Revision Author Commited Message
08aaf3 ... Diff Diff camjan Wed 20 May, 2015 21:26:51 +0000

Started with the separated DB with the given code

1cf395 ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:58:12 +0000

Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code

3a0296 ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:57:47 +0000

bookings were made to be taken from server per time they are searched

b09f34 ... Diff Diff camjan Wed 20 May, 2015 16:46:45 +0000

Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code

e3043c ... Diff Diff camjan Wed 20 May, 2015 16:45:21 +0000

Some bugs have been fixed

ccac99 ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:42:17 +0000

Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/domain/Owner.java
ruralHouses client/src/domain/RuralHouse.java
ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/dataAccess/DB4oManager.java
ruralHouses/src/domain/Booking.java

d30bcc ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:32:33 +0000

cleaning

4bc36b ... Diff Diff camjan Tue 19 May, 2015 23:23:13 +0000

Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/gui/HouseFeaturesGUI.java
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/domain/RuralHouse.java

fca164 ... Diff 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