/// <summary>
        /// 从数据库中获取所有课程
        /// </summary>
        /// <returns>所有课程</returns>
        public Courses GetAllCourses()
        {
            // 要返回的结果
            Courses AllCourses = new Courses();

            // 从本地数据库获取数据
            var             Database      = new DataContext();
            List <DbCourse> TempDbCourses = Database.DbCourses
                                            .Include(DbCourse => DbCourse.DbLocTimes)
                                            .ToList <DbCourse>();

            foreach (DbCourse TempDbCourse in TempDbCourses)
            {
                Course TempCourse = new Course();
                TempCourse.Name    = TempDbCourse.Name;
                TempCourse.Teacher = TempDbCourse.Teacher;
                TempCourse.Notes   = TempDbCourse.Notes;
                AllCourses.Add(TempCourse);
                if (TempDbCourse.DbLocTimes == null)
                {
                    continue;
                }
                foreach (DbLocTime TempDbLocTime in TempDbCourse.DbLocTimes)
                {
                    LocTime TempLocTime = new LocTime(
                        TempDbLocTime.Location,
                        TempDbLocTime.Week,
                        TempDbLocTime.WeekDay,
                        TempDbLocTime.BeginTime,
                        TempDbLocTime.EndTime,
                        0);
                    AllCourses.AddLocTime(TempDbCourse.Name, TempLocTime);
                }
            }

            return(AllCourses);
        }