Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
076d768e70e04655a2c343f46d0808c16a27130c
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
package businessLogic;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Vector;

import common.HouseInterface;

import dataAccess.DB4oManager;
import domain.Owner;
import domain.RuralHouse;


public class HouseManager extends UnicastRemoteObject implements HouseInterface {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	DB4oManager dbMngr;
	public HouseManager() throws RemoteException {
		super();
		try {
			dbMngr = DB4oManager.getInstance();
		} catch (Exception e) {

			e.printStackTrace();
		}
	}


	private boolean suitsRegulations(int nKitchens, int nBaths, int nLivings) {
		if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
			return false;
		else
			return true;
	}

	@Override
	public boolean registerNewHouse(RuralHouse rh) {

		boolean stored = false;
		if (!suitsRegulations(rh.getFeatures().getnRooms(), rh.getFeatures()
				.getnBaths(), rh.getFeatures().getnKitchens()))
			return false;
		stored = this.dbMngr.storeRuralHouses(rh);
		return stored;
	}

	public void removeHouse(RuralHouse rh, Owner owner) {
		Vector<RuralHouse> temp = owner.getRuralHouses();
		temp.remove(rh);
		this.dbMngr.removeHouse(rh, owner);
	}



	public Vector<RuralHouse> getHouses(Owner ow, String name,String town, int nBed, int nKit,
			int nBath, int nPark, int nLiv) {

		return this.dbMngr.getRuralHouses( ow, name ,town, nBed, nKit, nBath, nPark, nLiv);
	}
	
	


}

Commits for RRRRHHHH_CoderuralHouses/src/businessLogic/HouseManager.java

Diff revisions: vs.
Revision Author Commited Message
076d76 ... Diff Diff camjan Fri 22 May, 2015 22:22:23 +0000

The bug found in the presentation that we forgot to review has been fixed

3db092 ... Diff Diff camjan Thu 21 May, 2015 10:41:31 +0000

Separate DB almost fixed

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

cleaning

ad3773 ... Diff Diff pinene picture pinene Tue 19 May, 2015 18:01:40 +0000

data now is gotten using queries

799949 ... Diff Diff epinzolas001 Mon 18 May, 2015 11:12:36 +0000

debugging

4f8bcc ... Diff Diff epinzolas001 Mon 18 May, 2015 09:49:54 +0000

Merge conflicts solutioned

7bf57b ... Diff Diff camjan Sun 17 May, 2015 11:59:22 +0000

Possibility of registering new owners added

dd0098 ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 15:23:19 +0000

database management

520867 ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 14:09:12 +0000

tmp

5761bc ... camjan Wed 15 Apr, 2015 15:27:07 +0000

Bugs when deleting houses and offers fixed and GUI’s adapated for empty cases