Пример #1
0
        public ActionResult ShowBySlug(string Slug, int?p)
        {
            var cat = _categoryService.GetBySlug(Slug);

            if (cat == null)
            {
                return(Redirect("/" + SiteConstants.Instance.CategoryUrlIdentifier));
            }

            int limit = 10;

            try
            {
                limit = int.Parse(ThemesSetting.getValue("TopicPageLimit").ToString());
            }
            catch { }
            var count = _topicServic.GetCount(cat.Id);

            var Paging = CalcPaging(limit, p, count);

            var model = new CategoryTopicListViewModel
            {
                Cat       = cat,
                Paging    = Paging,
                ListTopic = _topicServic.GetList(cat.Id, limit, Paging.Page)
            };

            return(View(model));
        }
Пример #2
0
        public ActionResult PopupSelectList(string inputid, string inputname, int?p)
        {
            int limit = 12;
            var count = _topicServic.GetCount();

            var Paging = CalcPaging(limit, p, count);

            var model = new CategoryTopicListViewModel
            {
                Paging    = Paging,
                ListTopic = _topicServic.GetList(limit, Paging.Page)
            };

            return(View(model));
        }