RRRRHHHH_Code
Diff Revisions
1e12ff ...
vs
d23286 ...
for ruralHouses/src/businessLogic/LoginManager.java
|
@@ -1,8 +1,5 @@ |
1 |
1 |
|
package businessLogic; |
2 |
2 |
|
|
3 |
|
- |
|
4 |
|
- |
|
5 |
|
- |
|
6 |
3 |
|
import java.util.Vector; |
7 |
4 |
|
|
8 |
5 |
|
import dataAccess.DB4oManager; |
|
@@ -10,12 +7,11 @@ |
10 |
7 |
|
import domain.Owner; |
11 |
8 |
|
|
12 |
9 |
|
public class LoginManager implements LoginManagerInterface { |
13 |
|
- |
//owners to be separated to accounts later on |
|
10 |
+ |
|
14 |
11 |
|
DB4oManager dbMngr; |
15 |
|
- |
|
16 |
|
- |
|
|
12 |
+ |
|
17 |
13 |
|
public LoginManager() { |
18 |
|
- |
|
|
14 |
+ |
|
19 |
15 |
|
try { |
20 |
16 |
|
dbMngr = DB4oManager.getInstance(); |
21 |
17 |
|
} catch (Exception e) { |
|
@@ -24,21 +20,20 @@ |
24 |
20 |
|
} |
25 |
21 |
|
} |
26 |
22 |
|
|
27 |
|
- |
|
28 |
23 |
|
@Override |
29 |
24 |
|
public Owner checkCredentials(String usr, String pwd) { |
30 |
25 |
|
try { |
31 |
26 |
|
Vector<Account> account = dbMngr.getAccount(usr, pwd); |
32 |
|
- |
if(account.isEmpty()) return null; |
33 |
|
- |
else return account.get(0).getOwner(); |
34 |
|
- |
|
|
27 |
+ |
if (account.isEmpty()) |
|
28 |
+ |
return null; |
|
29 |
+ |
else |
|
30 |
+ |
return account.get(0).getOwner(); |
|
31 |
+ |
|
35 |
32 |
|
} catch (Exception e) { |
36 |
33 |
|
// TODO Auto-generated catch block |
37 |
34 |
|
e.printStackTrace(); |
38 |
35 |
|
} |
39 |
36 |
|
return null; |
40 |
37 |
|
} |
41 |
|
- |
|
42 |
|
- |
|
43 |
|
- |
|
|
38 |
+ |
|
44 |
39 |
|
} |