public ActionResult PopupSelect(string seach, string cat, int?p) { int limit = 10; var count = _topicServic.GetCount(); var Paging = CalcPaging(limit, p, count); var viewModel = new AdminTopicListViewModel { Paging = Paging, ListTopic = _topicServic.GetList(limit, Paging.Page) }; return(PartialView(viewModel)); }
// 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)); }