public bool IsCourseContributingToDegreeProgram(Course courseCheck, string studentIDCheck) { DegreeProgramDAL degreeChecker = new DegreeProgramDAL(); string degreeName = degreeChecker.GetDegreeProgramByStudentID(studentIDCheck); List <string> requiredCourses = degreeChecker.GetCourseNamesByDegreeProgram(degreeName); foreach (var currentCourse in requiredCourses) { if (currentCourse.Equals(courseCheck.Name)) { return(true); } } return(false); }
public bool CheckIfCourseContributesToMajor(int crn, string studentID) { DegreeProgramDAL degreeChecker = new DegreeProgramDAL(); string degree = degreeChecker.GetDegreeProgramByStudentID(studentID); List <string> degreeCourses = degreeChecker.GetCourseNamesByDegreeProgram(degree); CourseDAL courseChecker = new CourseDAL(); Course currentCourse = courseChecker.GetCourseByCRN(crn); bool isContributing = false; foreach (var names in degreeCourses) { if (names.Equals(currentCourse.Name)) { isContributing = true; } } return(isContributing); }