public bool CheckIfCanSignUpForCourseBasedOnTimes(int crn, string studentID, string semesterID) { //get all courses that a student is currently signed up for //check if those courses time's directly conflict with the new course's time bool canSignUp = true; CourseDAL courseGetter = new CourseDAL(); List <Course> currentCourses = courseGetter.GetCoursesByStudentIDAndSemester(studentID, semesterID); CourseTimeDAL timeChecker = new CourseTimeDAL(); CourseTime desiredTime = timeChecker.GetCourseTimeByCRN(crn); foreach (var currentCourse in currentCourses) { CourseTime currentTime = timeChecker.GetCourseTimeByCRN(currentCourse.CRN); foreach (var currentDay in currentTime.CourseDays.ToCharArray()) { foreach (var desiredDays in desiredTime.CourseDays.ToCharArray()) { if (desiredDays == currentDay) { if (desiredTime.CourseStart.TimeOfDay > currentTime.CourseStart.TimeOfDay && desiredTime.CourseStart.TimeOfDay < currentTime.CourseEnd.TimeOfDay) { canSignUp = false; return(canSignUp); } } } } } return(canSignUp); }