/// <summary> /// 初始化工作单元 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-02-19</para> /// </summary> /// <param name="unitOfWork">工作单元</param> private void InitUnitOfWork(UnitOfWork unitOfWork) { _makeLessonRepository = unitOfWork.GetCustomRepository <TblTimMakeLessonRepository, TblTimMakeLesson>(); _enrollOrderItemRepository = unitOfWork.GetCustomRepository <TblOdrEnrollOrderItemRepository, TblOdrEnrollOrderItem>(); _enrollOrderRepository = unitOfWork.GetCustomRepository <TblOdrEnrollOrderRepository, TblOdrEnrollOrder>(); _studentRecordRepository = unitOfWork.GetCustomRepository <ViewTimStudentRecordRepository, ViewTimStudentStudyRecord>(); }
/// <summary> /// 根据排课Id构建一个课次生产对象 /// <para>作 者:zhiwei.Tang</para> /// <para>创建时间:2019-02-19</para> /// </summary> /// <param name="makeLessonId">排课Id</param> /// <param name="unitOfWork">工作单元</param> public MakeLessonCreator(long makeLessonId, UnitOfWork unitOfWork) : base(makeLessonId) { this._unitOfWork = unitOfWork; _makeLessonRepository = unitOfWork.GetCustomRepository <TblTimMakeLessonRepository, TblTimMakeLesson>(); _enrollOrderRepository = unitOfWork.GetCustomRepository <TblOdrEnrollOrderRepository, TblOdrEnrollOrder>(); _enrollOrderItemRepository = unitOfWork.GetCustomRepository <TblOdrEnrollOrderItemRepository, TblOdrEnrollOrderItem>(); _viewClassTeacherDateRepository = unitOfWork.GetCustomRepository <ViewClassTeacherDateRepository, ViewClassTeacherDate>(); _viewChangeClassTimeRepository = unitOfWork.GetCustomRepository <ViewChangeClassTimeRepository, ViewChangeClassTime>(); _makeLesson = _makeLessonRepository.Load(makeLessonId); _classService = new DefaultClassService(_makeLesson.ClassId); _viewClassTeacherDates = _viewClassTeacherDateRepository.Get(_makeLesson.ClassId); _viewChangeClassTimeDates = _viewChangeClassTimeRepository.Get(_makeLesson.ClassId); }