Fakultas Ilmu Komputer UI

Commit 61f6dba0 authored by Bagus Prabowo's avatar Bagus Prabowo
Browse files

Student class fix

parent 8e201394
......@@ -38,8 +38,6 @@ public class Student extends Role {
System.out.println("Create a new timetable");
System.out.println("===============================");
TimetableList TimeList = new TimetableList();
Timetable newTimetable;
System.out.println("Timetable Name?");
......@@ -115,7 +113,7 @@ public class Student extends Role {
System.out.println(j++ + ". " + c.getCourseName());
}
CSVTimetable.addCourseTimetable(Main.currentUser.getUsername(), timetableName, addCourse);
CSVTimetable.updateCourseTimetable(Main.currentUser.getUsername(), timetableName, addCourse);
break;
......@@ -133,6 +131,7 @@ public class Student extends Role {
timetableName = in.next();
Timetable table = timetableList.getTimetable(timetableName, Main.currentUser);
List<Course> exist2 = table.getCourses();
if(table == null){
System.out.println("The table doesn't exists");
......@@ -158,7 +157,7 @@ public class Student extends Role {
System.out.println(j++ + ". " + c.getCourseName());
}
CSVTimetable.updateCourseTimetable(Main.currentUser.getUsername(), timetableName, delCourse);
break;
......
......@@ -38,7 +38,7 @@ public class CSVTimetable {
}
}
public static void addCourseTimetable(String name, String table, List<Course> newCourse){
public static void updateCourseTimetable(String name, String table, List<Course> newCourse){
try{
BufferedReader check = new BufferedReader(new FileReader("Timetable.csv"));
String row;
......
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