public ActionResult Listing()
        {
            CategoriesListingViewModel model = new CategoriesListingViewModel();

            model.Categories = categoriesService.GetAllCategories();
            return(PartialView(model));
        }
        public ActionResult Index()
        {
            CategoriesListingViewModel model = new CategoriesListingViewModel();

            model.PageTitle       = "Categories";
            model.PageDescription = "Categories Listing Page";
            return(View(model));
        }
        public ActionResult Index(string search)
        {
            var catsModel = new CategoriesListingViewModel();

            catsModel.PageTitle       = "Categories";
            catsModel.PageDescription = "Categories listing page.";

            catsModel.SearchTerm = search;

            return(View(catsModel));
        }
Пример #4
0
        public IActionResult Index()
        {
            var allForumCategories = this.categoryService
                                     .GetAll()
                                     .Select(c => new CategoryViewModel
            {
                Id          = c.Id,
                Title       = c.Title,
                Description = c.Description,
            });

            CategoriesListingViewModel model = new CategoriesListingViewModel
            {
                CategoriesList = allForumCategories,
            };

            return(this.View(model));
        }
        public PartialViewResult Listing(string search, int?pageNo)
        {
            int pageSize = 5;

            pageNo = pageNo ?? 1;

            var catsModel = new CategoriesListingViewModel();

            catsModel.AllCategories = CategoriesService.Instance.FilterCategories(search, pageNo.Value, pageSize);

            var totalCount = CategoriesService.Instance.GetCategoriesCount(search);

            catsModel.Pager = new Pager(totalCount, pageNo.Value, pageSize);

            catsModel.SearchTerm = search;

            return(PartialView(catsModel));
        }
        public ActionResult Index(int?parentCategoryID, string searchTerm, int?pageNo)
        {
            var recordSize = (int)RecordSizeEnums.Size10;

            CategoriesListingViewModel model = new CategoriesListingViewModel
            {
                ParentCategoryID = parentCategoryID,
                SearchTerm       = searchTerm,

                ParentCategories = CategoriesService.Instance.GetAllTopLevelCategories()
            };

            model.Categories = CategoriesService.Instance.SearchCategories(parentCategoryID, searchTerm, pageNo, recordSize, out int count);

            model.Pager = new Pager(count, pageNo, recordSize);

            return(View(model));
        }
Пример #7
0
        public ActionResult Index(int?parentCategoryID, string searchTerm, int?pageNo)
        {
            var pageSize = ConfigurationsHelper.DashboardRecordsSizePerPage;

            CategoriesListingViewModel model = new CategoriesListingViewModel();

            model.PageTitle       = "Categories";
            model.PageDescription = "Categories Listing Page";

            model.ParentCategoryID = parentCategoryID;
            model.SearchTerm       = searchTerm;

            model.ParentCategories = CategoriesService.Instance.GetAllParentCategories();

            model.Categories = CategoriesService.Instance.SearchCategories(parentCategoryID, searchTerm, pageNo, pageSize);
            var totalCategories = CategoriesService.Instance.GetCategoriesCount(parentCategoryID, searchTerm);

            model.Pager = new Pager(totalCategories, pageNo, pageSize);

            return(View(model));
        }