public List<Course> GetAllUnscheduledCourses(Course aCourse)
        {
            List<Course> unscheduleCourseList = new List<Course>();
            aCourseGateway = new CourseGateway();
            List<Course> courseList = new List<Course>();
            courseList = aCourseGateway.GetAllCoursesByDepartment(aCourse.ADepartment.DepartmentId,
                                                                  aCourse.ASemester.SemesterId);
            List<int> coursesId = new List<int>();
            int status;
            coursesId = aCourseGateway.GetScheduleCoursesId(aCourse);
            foreach (Course course in courseList)
            {
                status = 0;
                foreach (int courseId in coursesId)
                {
                    if (courseId == course.CourseId)
                    {
                        status = 1;
                    }

                }
                if (status == 0)
                {
                    unscheduleCourseList.Add(course);
                }
            }
            return unscheduleCourseList;
        }
        public List<Course> GetStudentMinorCourses(string departmentCode, string regNo)
        {
            int flag;
            CourseGateway aCourseGateway = new CourseGateway();
            List<Course> courseList = new List<Course>();
            List<Course> courses = new List<Course>();
            List<Course> newCourses = new List<Course>();
            courses = GetStudentCourses(regNo);
            courseList = aCourseGateway.GetCoursesByDepartment();
            foreach (Course deptCourse in courseList)
            {
                flag = 0;
                foreach (Course course in courses)
                {
                    if (deptCourse.CourseCode == course.CourseCode)
                        flag = 1;

                }
                if (flag == 0)
                    newCourses.Add(deptCourse);

            }
            return newCourses;
        }
        public List<Course> GetAllcourses(ViewStudentInformation aViewStudentInformation)
        {
            int flag;
            CourseGateway aCourseGateway = new CourseGateway();
            List<Course> courseList = new List<Course>();
            List<Course> courses = new List<Course>();
            List<Course> newCourses = new List<Course>();
            courses = GetStudentCourses(aViewStudentInformation.RegistationNo);
            courseList = aCourseGateway.GetCoursesByDepartment(aViewStudentInformation);
            foreach (Course deptCourse in courseList)
            {
                flag = 0;
                foreach (Course course in courses)
                {
                    if (deptCourse.CourseCode == course.CourseCode)
                        flag = 1;

                }
                if (flag == 0)
                    newCourses.Add(deptCourse);

            }
            return newCourses;
        }
 public string ResetCourseScheduleAndUnassignedAllCourse()
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.ResetCourseScheduleAndUnassignedAllCourse();
 }
 public List<ShowCourse> GetScheduleCoursesByDepartmentIdAndSemester(int departmentId, int semesterId)
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.GetScheduleCoursesByDepartmentIdAndSemester(departmentId, semesterId);
 }
 public List<ShowCourse> GetScheduleCoursesByDepartmentId(int departmentId)
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.GetScheduleCoursesByDepartmentId(departmentId);
 }
 public List<Course> GetAllUnassignedCourses(Course aCourse)
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.GetAllUnassignedCourses(aCourse);
 }
 public List<Course> GetAllCoursesByDepartment(int departmentId, int semesteId)
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.GetAllCoursesByDepartment(departmentId, semesteId);
 }
 public List<Course> GetAllCourses()
 {
     aCourseGateway = new CourseGateway();
     return aCourseGateway.GetAllCourses();
 }
 public string SaveCourse(Course aCourse)
 {
     aCourseGateway = new CourseGateway();
     if (!DoesThisCourseNameExist(aCourse))
         if (!DoesThisCourseCodeExist(aCourse))
             return aCourseGateway.SaveCourse(aCourse);
         else
             return "This Course Code already Exist";
     else
         return "This Course Name already Exist";
 }