public ActionResult GetLessons(int courseId)
        {
            LessonBll           bll      = new LessonBll();
            var                 lessons  = bll.GetLessons(courseId);
            var                 result   = lessons.ConvertTo <IList <LessonViewModel> >();
            SuccessJsonResponse response = new SuccessJsonResponse {
                Data = result
            };

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetDetails(int id)
        {
            CourseBll bll        = new CourseBll();
            var       dtoDetails = bll.GetDetailOfManagements(id);
            var       vm         = dtoDetails.ConvertTo <CurriculumDetailsViewModel>(
                PropertyNamePrefixAction.Remove);

            vm.CoverImage = UeditorContentFactory.RestoreUrl(vm.CoverImage, UeditorType.Image);
            SuccessJsonResponse response = new SuccessJsonResponse {
                Data = vm
            };

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult AddRelation(int subjectId, int relationSubjectId)
        {
            JsonSimpleResponse response = null;

            try
            {
                new SubjectGroupBll().AddRelation(subjectId, relationSubjectId, CurrentUserID);
                response = new SuccessJsonResponse();
            }
            catch (AbhsException ex)
            {
                response           = new JsonSimpleResponse();
                response.State     = false;
                response.ErrorCode = ex.ErrorCode;
                response.ErrorMsg  = ex.Message;
            }
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetDetails2(int id = 0)
        {
            SubjectBll         bll     = new SubjectBll();
            DtoSubject         subject = bll.GetSubjectDetails2(id);
            QuestionInputModel derived = ConvertToDerived2(subject?.Content);

            if (subject != null)
            {
                derived.Difficulty     = subject.Difficulty;
                derived.Explain        = subject.Content.Ysc_Explain;
                derived.Grade          = subject.Grade;
                derived.Id             = subject.Id;
                derived.Mark           = subject.Mark;
                derived.SubjectStatus  = (SubjectStatusEnum)subject.Status;
                derived.Keywords       = subject.Keywords;
                derived.Knowledge      = subject.MainKnowledge;
                derived.KnowledgeText  = subject.MainKnowledgeName;
                derived.Knowledges     = string.Join(",", subject.Knowledges);
                derived.KnowledgeTexts = subject.KnowledgeNames;
                derived.PlainName      = subject.Name;
                derived.Name           = FormatStem(derived.Name);
            }
            else
            {
                derived.Difficulty     = 0;
                derived.Explain        = string.Empty;
                derived.Grade          = 0;
                derived.Id             = 0;
                derived.Mark           = new List <string>();
                derived.SubjectStatus  = SubjectStatusEnum.编辑中;
                derived.Keywords       = string.Empty;
                derived.Knowledge      = 0;
                derived.KnowledgeText  = string.Empty;
                derived.Knowledges     = string.Empty;
                derived.KnowledgeTexts = new List <string>();
                derived.PlainName      = string.Empty;
                derived.Name           = string.Empty;
            }
            var response = new SuccessJsonResponse(derived);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetReadonlyDetails(int id)
        {
            SubjectBll         bll     = new SubjectBll();
            DtoSubject         subject = bll.GetSubjectDetails(id);
            QuestionInputModel derived = ConvertToDerived(subject.Content);

            derived.Difficulty     = subject.Difficulty;
            derived.Explain        = subject.Content.Ysc_Explain;
            derived.Grade          = subject.Grade;
            derived.Id             = subject.Id;
            derived.Mark           = subject.Mark;
            derived.SubjectStatus  = (SubjectStatusEnum)subject.Status;
            derived.Keywords       = subject.Keywords;
            derived.Knowledge      = subject.MainKnowledge;
            derived.KnowledgeText  = subject.MainKnowledgeName;
            derived.Knowledges     = string.Join(",", subject.Knowledges);
            derived.KnowledgeTexts = subject.KnowledgeNames;
            derived.PlainName      = subject.Name;
            derived.Name           = FormatReadonlyStem(derived.Name);
            var response = new SuccessJsonResponse(derived);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }