Exemplo n.º 1
0
        /// <summary>
        /// 批量增加授权
        /// <para>作    者: Huang GaoLiang </para>
        /// <para>创建时间: 2018-09-18 </para>
        /// </summary>
        /// <param name="dto">校区批量授权课程数据</param>
        public static async Task BatchSaveAsync(SchoolCourseSaveBatchRequest dto)
        {
            var schools = dto.Schools;

            // 1、获取所有校区编号
            foreach (string schoolId in schools)
            {
                SchoolCourseAccessService service = new SchoolCourseAccessService(schoolId, dto.CompanyId);

                // 处理后数据
                var course = dto.Course;
                await service.SaveCoverAsync(course);

                // 重新授权后,需要重新生成学习计划
                await StudyPlanService.AsyncSchoolCourse(schoolId);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 创建一个授权校区
        /// <para>作    者: Huang GaoLiang </para>
        /// <para>创建时间: 2019-02-18</para>
        /// </summary>
        /// <param name="schoolId">校区编号</param>
        /// <param name="companyId">公司编号</param>
        /// <returns>返回校区授权课程信息</returns>
        public static SchoolCourseAccessService CreateAccess(string schoolId, string companyId)
        {
            SchoolCourseAccessService service = new SchoolCourseAccessService(schoolId, companyId);

            return(service);
        }