Example #1
0
        public void SubjectBll_GetSubjects_GetByIdShouldReturnValue()
        {
            var search = new DtoQuestionSearch()
            {
                Id = 10098
            };
            var result = bll.GetSubjects(search);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 1);
        }
Example #2
0
        public JsonResult GetQuestions(DtoQuestionSearch search)
        {
            //此处只需要合格状态的数据
            search.SubjectStatus = SubjectStatusEnum.合格;
            SubjectBll         bll      = new SubjectBll();
            IList <Yw_Subject> subjects = bll.GetSubjects(search);

            IEnumerable <SubjectViewModel> list =
                subjects.Select(s => SubjectViewModel.Create(s));
            var table = AbhsTableFactory.Create(list, search.Pagination.TotalCount);

            return(Json(table, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public JsonResult GetMyQuestions(DtoQuestionSearch search)
        {
            //if (!search.SubjectStatus.HasValue || (int)search.SubjectStatus.Value == 0)
            //{
            //    search.SubjectStatus= SubjectStatusEnum.
            //}
            SubjectBll         bll      = new SubjectBll();
            IList <Yw_Subject> subjects = bll.GetSubjects(search);

            IEnumerable <SubjectViewModel> list =
                subjects.Select(s => SubjectViewModel.Create(s));
            var table = AbhsTableFactory.Create(list, search.Pagination.TotalCount);

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