Пример #1
0
        //makes a list of all course
        public List <Models.Course> Courses(Dal.AD ad, Dal.SQL sql)
        {
            List <Models.Course> Output  = new List <Models.Course>();
            List <Models.Course> courses = sql.GetCourseList();

            foreach (Models.Course c in courses)
            {
                List <string> students = sql.GetStudentsForCourse(c.CourseNumber, c.StartCourse, c.EndCourse);
                for (int i = 0; i < students.Count; i++)
                {
                    students[i] = ad.GetUserInfo(students[i]).Name;
                }
                Output.Add(new Models.Course(0, c.CourseNumber, c.StartCourse, c.EndCourse, students));
            }
            return(Output);
        }