Example #1
0
        /// <summary>
        /// 获取补课信息
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2019-03-13</para>
        /// </summary>
        /// <param name="outReplenishLessonList">转出的补课信息列表</param>
        /// <param name="replenishLessonCreatorInfo">课次调整对象</param>
        /// <param name="lessonModel">新构建的课次信息</param>
        /// <returns>补课信息构建</returns>
        private TblTimReplenishLesson GetTblTimReplenishLesson(
            List <TblTimReplenishLesson> outReplenishLessonList,
            ReplenishLessonCreatorInfo replenishLessonCreatorInfo,
            TblTimLesson lessonModel)
        {
            var outReplenishLesson = outReplenishLessonList
                                     .FirstOrDefault(x => x.LessonId == replenishLessonCreatorInfo.OutLessonId);

            TblTimReplenishLesson replenishLessonModel = new TblTimReplenishLesson
            {
                AdjustType        = (int)AdjustType.DEFAULT,
                AttendDate        = null,
                AttendStatus      = (int)AttendStatus.NotClockIn,
                AttendUserType    = (int)AttendUserType.DEFAULT,
                CreateTime        = DateTime.Now,
                LessonId          = lessonModel.LessonId,
                ParentLessonId    = replenishLessonCreatorInfo.OutLessonId,
                ReplenishCode     = string.Empty,
                ReplenishLessonId = IdGenerator.NextId(),
                RootLessonId      = outReplenishLesson == null ? replenishLessonCreatorInfo.OutLessonId : outReplenishLesson.RootLessonId,
                SchoolId          = replenishLessonCreatorInfo.SchoolId,
                StudentId         = replenishLessonCreatorInfo.StudentId,
                UpdateTime        = DateTime.Now
            };

            return(replenishLessonModel);
        }
Example #2
0
        /// <summary>
        /// 获取课次信息数据
        /// <para>作    者:zhiwei.Tang</para>
        /// <para>创建时间:2019-03-13</para>
        /// </summary>
        /// <param name="model">课次调整数据源</param>
        /// <returns>课次信息数据</returns>
        private TblTimLesson GetTblTimLesson(ReplenishLessonCreatorInfo model)
        {
            DateTime classBeginDate; //上课开始时间
            DateTime classEndDate;   //上课结束时间

            if (model.LessonType == LessonType.RegularCourse)
            {
                classBeginDate = DateTime.Parse($"{model.ClassDate:yyyy-MM-dd} {model.ClassBeginTime}");
                classEndDate   = DateTime.Parse($"{model.ClassDate:yyyy-MM-dd} {model.ClassEndTime}");
            }
            else
            {
                classBeginDate = DateTime.Parse(model.ClassBeginTime);
                classEndDate   = DateTime.Parse(model.ClassEndTime);
            }

            TblTimLesson lessonModel = new TblTimLesson
            {
                LessonId          = IdGenerator.NextId(),
                BusinessId        = model.BusinessId,
                BusinessType      = (int)model.BusinessType,
                ClassBeginTime    = model.ClassBeginTime,
                ClassDate         = model.ClassDate,
                ClassEndTime      = model.ClassEndTime,
                ClassId           = model.ClassId,
                ClassRoomId       = model.ClassRoomId,
                CourseId          = model.CourseId,
                CourseLevelId     = model.CourseLevelId,
                EnrollOrderItemId = model.EnrollOrderItemId,
                SchoolId          = model.SchoolId,
                StudentId         = model.StudentId,
                TeacherId         = model.TeacherId,
                TermId            = model.TermId,
                LessonType        = (int)model.LessonType,
                LessonCount       = model.LessonCount,
                Status            = (int)LessonUltimateStatus.Normal,
                CreateTime        = DateTime.Now,
                UpdateTime        = DateTime.Now,
                ClassBeginDate    = classBeginDate,
                ClassEndDate      = classEndDate
            };

            return(lessonModel);
        }
Example #3
0
        /// <summary>
        /// 获取补课周补课信息
        /// <para>作    者:Huang GaoLiang </para>
        /// <para>创建时间:2019-03-13 </para>
        /// </summary>
        /// <returns>返回补课周补课信息</returns>
        public List <ReplenishLessonCreatorInfo> GetReplenishLessonCreatorInfo()
        {
            List <ReplenishLessonCreatorInfo> replenishLessonList = new List <ReplenishLessonCreatorInfo>();

            // 根据课次编号获取课次基础信息
            int index = 0;

            foreach (var m in _replenishWeekClassTime.WeekClassTimeList)
            {
                var timeLess     = _studentTimeLessList[index];
                var adjustLesson = _adjustLessonList[index];

                ReplenishLessonCreatorInfo info = new ReplenishLessonCreatorInfo
                {
                    OutLessonId       = timeLess.LessonId,
                    SchoolId          = this._schoolId,
                    EnrollOrderItemId = this._replenishWeekClassTime.EnrollOrderItemId,
                    StudentId         = this._studentId,
                    ClassDate         = m.ClassDate,
                    ClassBeginTime    = m.ClassBeginTime,
                    ClassEndTime      = m.ClassEndTime,
                    TermId            = this._termId,
                    ClassId           = this._replenishWeekClassTime.NewClassId,
                    CourseId          = this._replenishWeekClassTime.CourseId,
                    CourseLevelId     = this._replenishWeekClassTime.CourseLevelId,
                    TeacherId         = this._replenishWeekClassTime.TeacherId,
                    ClassRoomId       = m.ClassRoomId,
                    LessonType        = LessonType.RegularCourse,
                    BusinessId        = adjustLesson.AdjustLessonId,
                    BusinessType      = (LessonBusinessType)base.BusinessType
                };
                index++;
                replenishLessonList.Add(info);
            }


            return(replenishLessonList);
        }