RRRRHHHH_Code
Diff Revisions
0f75b2 ...
vs
7bf57b ...
for ruralHouses/src/businessLogic/AdminManager.java
|
@@ -2,6 +2,7 @@ |
2 |
2 |
|
|
3 |
3 |
|
import java.util.Vector; |
4 |
4 |
|
|
|
5 |
+ |
import domain.Account; |
5 |
6 |
|
import domain.Administrator; |
6 |
7 |
|
import domain.RuralHouse; |
7 |
8 |
|
|
|
@@ -20,6 +21,11 @@ |
20 |
21 |
|
.getRemoveRequest()); |
21 |
22 |
|
} |
22 |
23 |
|
|
|
24 |
+ |
public Vector<Account> getOwnerAdditionReuests() { |
|
25 |
+ |
return new Vector<Account>(Administrator.getInstance() |
|
26 |
+ |
.getNewOwnerRequest()); |
|
27 |
+ |
} |
|
28 |
+ |
|
23 |
29 |
|
public void removeHouseAdditionRequests(RuralHouse house) { |
24 |
30 |
|
Administrator.getInstance().getAddRequest().remove(house); |
25 |
31 |
|
} |
|
@@ -27,7 +33,9 @@ |
27 |
33 |
|
public void removeHouseDeletionRequests(RuralHouse house) { |
28 |
34 |
|
Administrator.getInstance().getRemoveRequest().remove(house); |
29 |
35 |
|
} |
30 |
|
- |
|
|
36 |
+ |
public void removeOwnerAdditionRequests(Account acc) { |
|
37 |
+ |
Administrator.getInstance().getNewOwnerRequest().remove(acc); |
|
38 |
+ |
} |
31 |
39 |
|
public boolean addAdditionRequest(RuralHouse rh) { |
32 |
40 |
|
if (this.getAdditionRequests().contains(rh)) { |
33 |
41 |
|
return false; |
|
@@ -40,4 +48,17 @@ |
40 |
48 |
|
return false; |
41 |
49 |
|
return Administrator.getInstance().getRemoveRequest().add(rh); |
42 |
50 |
|
} |
|
51 |
+ |
|
|
52 |
+ |
public boolean addAccount(Account acc) { |
|
53 |
+ |
if (this.getOwnerAdditionReuests().contains(acc)) { |
|
54 |
+ |
return false; |
|
55 |
+ |
} |
|
56 |
+ |
return Administrator.getInstance().getNewOwnerRequest().add(acc); |
|
57 |
+ |
} |
|
58 |
+ |
|
|
59 |
+ |
// public boolean removeAccount(Account acc) { |
|
60 |
+ |
// if (this.getDeletionRequests().contains(acc)) |
|
61 |
+ |
// return false; |
|
62 |
+ |
// return Administrator.getInstance().getNewOwnerRequest().add(acc); |
|
63 |
+ |
// } |
43 |
64 |
|
} |