コード例 #1
0
        /// <summary>
        /// 生成课程学习计划(包括寒假特训营和暑假特训营)
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2018-11-05</para>
        /// </summary>
        /// <param name="term">课程学习计划详情对象</param>
        /// <param name="numbers">个数</param>
        /// <param name="seasonName">季节名称</param>
        /// <returns>学习课程计划详细信息</returns>
        private StudyPlanTermResponse GenerateStudyPlanTerm(TblOdrStudyPlanTerm term, int numbers, string seasonName)
        {
            StudyPlanTermResponse termResponse = new StudyPlanTermResponse {
                Season = seasonName
            };

            //校区存在学习计划学期,则生成寒假特训营(包括一个和两个的课程)/暑假特训营(包括一个、两个和三个的课程)的课程
            if (term != null)
            {
                for (int j = 1; j < numbers; j++)
                {
                    StudyPlanTermItemResponse termItem = new StudyPlanTermItemResponse
                    {
                        ClassTimes  = term.Classes90 * j,
                        Name        = j.GetNumberCnName() + OrdersConstants.Piece,
                        TermTypeId  = term.TermTypeId,
                        MaterialFee = term.MaterialFee,
                        TuitionFee  = term.TuitionFee,
                        Duration    = 90
                    };
                    termResponse.Data.Add(termItem);
                }
            }
            return(termResponse);
        }
コード例 #2
0
        /// <summary>
        /// 生成课程学习计划(包括春季班和秋季班)
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2018-11-05</para>
        /// </summary>
        /// <param name="term">课程学习计划详情对象</param>
        /// <param name="studyPlanList">课程学习计划对象</param>
        /// <param name="birthday">出生日期</param>
        /// <param name="seasonName">季节名称</param>
        /// <returns>学习课程计划详细信息</returns>
        private StudyPlanTermResponse GenerateStudyPlanTerm(TblOdrStudyPlanTerm term, List <TblOdrStudyPlan> studyPlanList, DateTime birthday, string seasonName)
        {
            StudyPlanTermResponse springTermResponse = new StudyPlanTermResponse {
                Season = seasonName
            };

            //校区存在学习计划学期,则生成春季班/秋季班的课程(包括必修课和选修课)
            if (term != null)
            {
                int age = Age.GetAgeByDate(birthday, term.BeginDate);//学生年龄
                //根据学生年龄,获取对应的学习计划课程
                var studyPlan = studyPlanList.FirstOrDefault(a => a.Age == age);
                if (studyPlan != null)
                {
                    //必修课
                    StudyPlanTermItemResponse requiredItem = new StudyPlanTermItemResponse
                    {
                        ClassTimes    = GetClassTimesByMinutes(term, studyPlan.Duration),//计算出课次
                        Name          = studyPlan.CourseName + (studyPlan.CourseLevelName == OrdersConstants.Nothing ? "" : studyPlan.CourseLevelName.Replace(OrdersConstants.Level, "")),
                        CourseId      = studyPlan.CourseId,
                        CourseLevelId = studyPlan.CourseLevelId,
                        CourseType    = CourseType.Compulsory,
                        TermTypeId    = term.TermTypeId,
                        MaterialFee   = term.MaterialFee,
                        TuitionFee    = term.TuitionFee,
                        Duration      = studyPlan.Duration
                    };
                    springTermResponse.Data.Add(requiredItem);
                }
                //选修课
                StudyPlanTermItemResponse optionalItem = new StudyPlanTermItemResponse
                {
                    Name        = OrdersConstants.OptionalLesson,
                    ClassTimes  = term.Classes90,
                    CourseType  = CourseType.Elective,
                    TermTypeId  = term.TermTypeId,
                    MaterialFee = term.MaterialFee,
                    TuitionFee  = term.TuitionFee,
                    Duration    = 90
                };
                springTermResponse.Data.Add(optionalItem);
            }
            return(springTermResponse);
        }