-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserController.java
49 lines (44 loc) · 1.23 KB
/
UserController.java
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
package Controller;
import Model.User;
import java.util.HashMap;
import Model.Kanban;
public class UserController {
private User user;
public UserController (User user){
this.user = user;
}
public void createProductOwner(String name, String password, float ID){
String id = String.valueOf(ID);
String userName = name+user.PRODUCT_OWNER+Float.valueOf(id);
user.setUserName(userName);
user.setPassword(password);
user.setOwner(true);
System.out.println("New User Created " + userName);
System.out.println("Password: "+password);
System.out.println("Is owner "+user.isOwner());
}
/**
* Creates a software devloper User;
* @param name
* @param password
* @param ID
*/
public void createSoftwareDev(String name, String password, float ID){
String id = String.valueOf(ID);
String userName = name+"DEV"+id;
user.setUserName(userName);
user.setPassword(password);
user.setOwner(false);
System.out.println("New User Created " + userName);
}
public boolean UserExisits(HashMap <String,User> list, String name, String password){
boolean outcome = false;
User user = list.get(name);
if (user != null){
if (user.getPassword().equals(password)){
outcome = true;
}
}
return outcome;
}
}