コード例 #1
0
        /// <summary>
        /// 课程类别列表
        /// </summary>
        /// <param name="input">课程类别列表搜索请求</param>
        /// <returns></returns>
        public async Task <IActionResult> List(CourseCategorySearchInput input)
        {
            var model = new Page <CourseCategoryViewDto>();

            var items = await _service.GetCourseCategoryPageList(input);

            model.CurrentPage  = input.PageIndex;
            model.TotalRecords = items.Item2;
            model.Items        = items.Item1;

            return(PartialView("_ListPartial", model));
        }
コード例 #2
0
        /// <summary>
        /// 根据课程类别搜索输入分页获取课程类别列表
        /// </summary>
        /// <param name="input">课程类别搜索输入</param>
        /// <returns>课程类别列表</returns>
        public async Task <Tuple <List <CourseCategoryViewDto>, int> > GetCourseCategoryPageList(CourseCategorySearchInput input)
        {
            var newInput = new DictionarySearchInput {
                Name = input.CategoryName, PageIndex = input.PageIndex, PageSize = input.PageSize, ParentValue = CommConstant.PatientEduParentValue
            };
            var result = await _systemRepository.GetDictionaryPageList(newInput);

            var tuple = new Tuple <List <CourseCategoryViewDto>, int>(Mapper.Map <List <Dictionary>, List <CourseCategoryViewDto> >(result.Item1), result.Item2);

            return(tuple);
        }