public List <List <String> > getPrecourse(String courseName) { List <List <String> > preCourseSet = new List <List <String> >(); if (!CourseNameApi.existsByCourseName(courseName)) { return(null); } else { List <String> temp = getPrecouseName(courseName); List <String> temp1 = new List <String>(); List <String> temp2 = new List <String>(); preCourseSet.Add(temp); foreach (String i in temp) { temp1 = getPrecouseName(i); foreach (String j in temp1) { if (!temp2.Contains(j)) { temp2.Add(j); } } } preCourseSet.Add(temp2); } return(preCourseSet); }
public List <String> getPrecouseName(String courseName) { if (!CourseNameApi.existsByCourseName(courseName)) { return(null); } else { int?couseId = CourseNameApi.findByCourseName(courseName).courseNameID; List <CourseRelation> courseRelations = CourseRelationApi.findByCourseNameID(couseId); return(getCoursesName(courseRelations)); } }