Exemple #1
0
        public JsonResult GetCourseAppList(int CourseID)
        {
            ApplyPartModel appList  = appbll.GetCourseAppList(CourseID);
            KingResponse   response = KingResponse.GetResponse(null, appList);

            return(Json(response));
        }
Exemple #2
0
        /// <summary>
        /// 获取云课堂子应用
        /// </summary>
        /// <param name="subjectID"></param>
        /// <param name="ediID"></param>
        /// <param name="gradeID"></param>
        /// <param name="BookletID"></param>
        /// <returns></returns>
        public ApplyPartModel GetCourseAppList(int CourseID)
        {
            using (var db = new ModMetaEntities())
            {
                using (var dbres = new MODResourceEntities())
                {
                    ApplyPartModel applyModel = new ApplyPartModel();
                    applyModel.appList = new List <AppPartModel>();
                    tb_Course       course = dbres.tb_Course.Find(CourseID);
                    tb_StandardBook book   = db.tb_StandardBook.Where(w => w.Edition == course.EditionID && w.Subject.ToString() == course.Subject && w.Grade.ToString() == course.Grade && w.Booklet == course.BookReel && w.Deleted == 0).FirstOrDefault();
                    applyModel.ImageUrl = AppSetting.ReslibUrl + "/DigitalClass/" + course.CoursePath + "/Course.gif";
                    applyModel.BookUrl  = AppSetting.ReslibUrl + "/DigitalClass/" + course.CoursePath + "/Start.htm";
                    applyModel.appList  = dbres.tb_CourseApp.Where(w => w.CourseID == CourseID).Select(apps => new AppPartModel
                    {
                        AppName = apps.AppName,
                        AppType = apps.AppType,
                        Url     = apps.AppType == 0? (apps.Folder + "?BookID=" + book.ID): (AppSetting.ReslibUrl + "/DigitalClass/" + course.CoursePath + "/" + apps.Folder + "/Start.htm")
                    }).ToList();

                    return(applyModel);
                }
            }
        }