Fakultas Ilmu Komputer UI

Commit 5fb63536 authored by Bagus Prabowo's avatar Bagus Prabowo
Browse files

CSV Operator Fix

parent b405d28f
admin,Admin
st,Student
ta,Teaching Assistant
a,Student
b,Teaching Assistant
......@@ -50,7 +50,7 @@ public class Main {
System.out.println("Username?");
username = in.next();
for (User user : userList.getUserList()) {
if (username.equals(user.getUsername())) {
if (username.equalsIgnoreCase(user.getUsername())) {
System.out.println("The user already exists");
return;
}
......
......@@ -3,7 +3,7 @@ package Softeng.Group3.SiJadwal.actor;
public enum RoleType {
STUDENT, TEACHING_ASSISTANT, ADMIN;
public String toString(RoleType roleType) {
public static String RoletoString(RoleType roleType) {
switch (roleType){
case STUDENT:
return "Student";
......
......@@ -29,7 +29,7 @@ public class UserList {
newUser.setUsername(username);
newUser.setRole(role);
userList.add(newUser);
CSVOperator.writeUser(username, role.toString());
CSVOperator.writeUser(username, RoleType.RoletoString(role));
}
public void updateRole(String username, RoleType role){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment