public ActionResult Index(string s, int?p) { int limit = 12; var count = _topicServic.GetCount(s); var Paging = CalcPaging(limit, p, count); var model = new TopicListViewModel { Paging = Paging, ListTopic = _topicServic.GetList(s, limit, Paging.Page) }; return(View(model)); }
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)); }
// GET: Admin/AdminTopic public ActionResult Index(int?p, Guid?catid, string seach = null) { Category cat = null; if (catid != null) { cat = _categoryService.Get((Guid)catid); } int count = _topicServic.GetCount(cat?.Id, seach); int limit = 10; //if (cat != null) //{ // count = _topicServic.GetCount(cat.Id); //} //else //{ // count = _topicServic.GetCount(); //} var Paging = CalcPaging(limit, p, count); List <Topic> lst = _topicServic.GetList(cat?.Id, seach, limit, Paging.Page); //if (cat != null) //{ // lst = _topicServic.GetList(cat.Id, limit, Paging.Page); //} //else //{ // lst = _topicServic.GetList(limit, Paging.Page); //} var model = new AdminTopicListViewModel { Seach = seach, Cat = cat, Paging = Paging, ListTopic = lst, //AllCategories = _categoryService.GetBaseSelectListCategories(_categoryService.GetList(false)) }; return(View(model)); }