/// <summary> /// 获取排课数据基础数据源 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-02-19</para> /// </summary> /// <param name="schoolId">校区Id</param> /// <param name="classIds">班级Id</param> /// <param name="companyId">公司编号</param> /// <returns>返回排课数据源组合的基础数据源</returns> private static MakeLessonResponseBasicData GetMakeLessonResponseBasicData(string schoolId, IEnumerable <long> classIds, string companyId) { MakeLessonResponseBasicData res = new MakeLessonResponseBasicData { ClassInfos = DefaultClassService.GetClassByClassIdAsync(classIds).Result, ClassRooms = new SchoolClassRoomService(schoolId).GetAllEnableClassRoom(), Courses = CourseService.GetAllAsync().Result, CourseLevels = new CourseLevelService(companyId).GetList().Result }; return(res); }
/// <summary> /// 获取班级信息 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-02-19</para> /// </summary> /// <param name="basicData">返回排课数据组合需要的基础数据</param> /// <param name="classId">班级Id</param> /// <returns>班级信息</returns> private static ClassInfo GetClassInfo(MakeLessonResponseBasicData basicData, long classId) { var classInfo = (from a in basicData.ClassInfos join b in basicData.Courses on a.CourseId equals b.CourseId join c in basicData.CourseLevels on a.CourseLeveId equals c.CourseLevelId join d in basicData.ClassRooms on a.ClassRoomId equals d.ClassRoomId where a.ClassId == classId select new ClassInfo { ClassId = a.ClassId, ClassName = b.ClassCnName, ClassNo = a.ClassNo, RoomNo = d.RoomNo, LevelName = c.LevelCnName }).FirstOrDefault(); return(classInfo); }