Fakultas Ilmu Komputer UI

Commit 8a450a9b authored by Bagus Prabowo's avatar Bagus Prabowo
Browse files

Course deletion with timetable connection

parent 10171934
Pipeline #81809 failed with stages
in 8 minutes and 44 seconds
rpl,ade,1:01:01,1:01:02
adpro,daya,5:05:05,7:07:07
daa,there,4:04:04,13:01:01
\ No newline at end of file
daa,there,4:04:04,13:01:01
package Softeng.Group3.SiJadwal.repository;
import Softeng.Group3.SiJadwal.Main;
import Softeng.Group3.SiJadwal.model.Course;
import Softeng.Group3.SiJadwal.model.Timetable;
import java.sql.Time;
import java.util.ArrayList;
......@@ -46,6 +48,19 @@ public class CourseList {
public void deleteCourse(String name){
Course delCourse = getCourse(name);
TimetableList timetableList = new TimetableList();
List<Timetable> containsCourse = TimetableList.getAllTimetableList();
for(int i = 0; i < containsCourse.size(); i++){
List<Course> courses = containsCourse.get(i).getCourses();
for(int j = 0; j < courses.size(); j++){
if(courses.get(j).getCourseName().equalsIgnoreCase(delCourse.getCourseName())){
timetableList.getTimetable(containsCourse.get(i).getTimetableName(), containsCourse.get(i).getOwner()).deleteCourse(delCourse);
CSVTimetable.updateCourseTimetable(containsCourse.get(i).getOwner().getUsername(), containsCourse.get(i).getTimetableName(), containsCourse.get(i).getCourses());
break;
}
}
}
courseList.remove(delCourse);
CSVCourse.deleteCourse(name);
}
......
package Softeng.Group3.SiJadwal.repository;
import Softeng.Group3.SiJadwal.Main;
import Softeng.Group3.SiJadwal.actor.RoleType;
import Softeng.Group3.SiJadwal.actor.User;
import Softeng.Group3.SiJadwal.model.Course;
import Softeng.Group3.SiJadwal.model.Timetable;
import java.sql.Time;
import java.util.ArrayList;
import java.util.List;
......
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