Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
66f0c834c28b40aeac91b173d6def82e24c3b02b
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package businessLogic;

import java.rmi.RemoteException;
import java.util.Date;
import java.util.Vector;

import dataAccess.DB4oManager;
import domain.Account;
import domain.HouseFeatures;
import domain.Offer;
import domain.Owner;
import domain.RuralHouse;

public class HouseManager implements HouseManagerInterface {
	DB4oManager dbMngr;

	public HouseManager() {
		try {
			dbMngr = DB4oManager.getInstance();
		} catch (Exception e) {

			e.printStackTrace();
		}
	}



	@Override
	public boolean registerNewHouse(String houseName, Owner owner,
			String description, String district, int nRooms, int nKitchens,
			int nBaths, int nLivings, int nParkings) {
		
		boolean stored = false;
		if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
			return false;
		HouseFeatures feature = new HouseFeatures(nRooms, nKitchens, nBaths,
				nLivings, nParkings);
		RuralHouse rh = new RuralHouse(houseName,
				owner, description, district, feature);
		owner.getRuralHouses().add(rh);
		stored = this.dbMngr.storeRuralHouses(rh);
		return stored;
	}
	
	@Override

	public boolean registerNewHouse(RuralHouse rh) {
		
		boolean stored = false;
		
		rh.getOwner().getRuralHouses().add(rh);
		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);
	}



	@Override
	public Vector<RuralHouse> getHousesByDistrict(String town) {
		
		return this.dbMngr.getRuralHousesByTown(town);
	}
	
	public Vector<RuralHouse> getHouses(String town,int nBed , int nKit, int nBath, int nPark, int nLiv) {
		
		return this.dbMngr.getRuralHouses(town, nBed, nKit, nBath, nPark, nLiv);
	}



	@Override
	public Vector<RuralHouse> getAllRuralHouses() throws RemoteException,
			Exception {
		return dbMngr.getAllRuralHouses();
	}



	@Override
	public RuralHouse getHouseByName(String Name) {
		return this.dbMngr.getRuralHouseByName(Name);
	}





	// For future implementation
	// @Override
	// public void modifyHouse(int houseName, Owner owner, String description,
	// String town, int nRooms, int nKitchens, int nBaths, int nLivings,
	// int nParkings) {
	// // TODO Auto-generated method stub
	//
	// }

	// Maybe returning the offer is not necessary. Depends on GUI
	// implementation.

}

Commits for RRRRHHHH_CoderuralHouses/src/businessLogic/HouseManager.java

Diff revisions: vs.
Revision Author Commited Message
66f0c8 ... Diff Diff Eneko Pinzolas Murua Sun 12 Apr, 2015 18:11:42 +0000

Model modified so that owners now request for a new house insetion or a house removal. Furthermore, all Administrator GUI and bussines logic create. However, Login GUI and BussinesLogic are to be modified so that they integrate Admin identification.

afdc66 ... Diff Diff camjan Wed 25 Mar, 2015 16:43:35 +0000

Villatripas de arriba districs added and the option of searching houses with diferent parameters

82c870 ... Diff Diff pinene picture pinene Tue 10 Mar, 2015 13:32:30 +0000

DeleteHouses bug debugged

bb8482 ... Diff Diff Eneko Pinzolas Murua Tue 10 Mar, 2015 13:23:13 +0000

temp

6d133a ... Diff Diff camjan Tue 10 Mar, 2015 13:09:05 +0000

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

Conflicts:
ruralHouses/src/gui/DeleteHouseGUI.java

bd03dd ... Diff Diff camjan Tue 10 Mar, 2015 13:06:22 +0000

Administrator class created delete debbuging started

5c77c5 ... Diff Diff Eneko Pinzolas Murua Tue 10 Mar, 2015 12:52:32 +0000

for testing purpouses

7c0734 ... Diff Diff Eneko Pinzolas Murua Tue 10 Mar, 2015 12:15:11 +0000

house code changed to name

e16868 ... Diff Diff Eneko Pinzolas Murua Mon 09 Mar, 2015 13:02:33 +0000

deleted aplicationFacade and imported it’s functions to specific business logics.

44451e ... camjan Sun 08 Mar, 2015 12:59:14 +0000

Some minor changes and the logic for searching rural houses by the name of the town done