Git Repository Public Repository

RRRRHHHH_Code

URLs

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

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

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

public class HouseManager implements HouseManagerInterface {
	DB4oManager dbMngr;

	public HouseManager() {
		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().getnKitchens(), 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(String name,String town, int nBed, int nKit,
			int nBath, int nPark, int nLiv) {

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

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



	// 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
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 ... Diff Diff camjan Wed 15 Apr, 2015 15:27:07 +0000

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

e2ae30 ... Diff Diff Eneko Pinzolas Murua Tue 14 Apr, 2015 15:07:35 +0000

imports leaned

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 ... camjan Tue 10 Mar, 2015 13:06:22 +0000

Administrator class created delete debbuging started