Exemplo n.º 1
0
        private IEnumerable <TestCategory> CategoryRender(string actionName, string typeCode, int partId, int categoryPage = 1, string categorySearchKey = "")
        {
            int categoryStart = (categoryPage - 1) * Config.PAGE_PAGINATION_LIMIT;

            var testCategories = _TestCategoryManager.GetByPagination(typeCode, partId, categoryStart, Config.PAGE_PAGINATION_LIMIT);

            // Tạo đối tượng phân trang cho Category
            ViewBag.CategoryPagination = new Pagination(actionName, NameUtils.ControllerName <SpeakingManagerController>())
            {
                PageKey     = nameof(categoryPage),
                PageCurrent = categoryPage,
                NumberPage  = PaginationUtils.TotalPageCount(
                    _TestCategoryManager.GetAll(typeCode, partId).Count(),
                    Config.PAGE_PAGINATION_LIMIT),
                Offset = Config.PAGE_PAGINATION_LIMIT
            };
            return(testCategories);
        }