public ActionResult Hi_Ajax_Topic(string title = "", int p = 1) { int pageNo = p; TopicAjaxModel model = new TopicAjaxModel() { list = new List <TopicContent>() }; InitialCateModel(model, title, pageNo); return(Json(model, JsonRequestBehavior.AllowGet)); }
public ActionResult Hi_Ajax_Topic(string title = "", int p = 1) { int pageNo = p; long shopId = CurrentSellerManager.ShopId; TopicAjaxModel model = new TopicAjaxModel() { list = new List <TopicContent>() }; InitialCateModel(model, title, pageNo, shopId); return(Json(model, JsonRequestBehavior.AllowGet)); }
private void InitialCateContentModel(IQueryable <TopicInfo> topicList, TopicAjaxModel model) { foreach (var topic in topicList) { model.list.Add(new TopicContent { create_time = "", item_id = topic.Id, link = "/m-Wap/topic/detail/" + topic.Id, pic = "", title = topic.Name, tag = topic.Tags }); } }
private void InitialCateContentModel(IEnumerable <TopicInfo> topicList, TopicAjaxModel model) { foreach (TopicInfo info in topicList) { TopicContent item = new TopicContent { create_time = "", item_id = info.Id, link = "/m-wap/topic/detail/" + info.Id, pic = "", title = info.Name, tag = info.Tags }; model.list.Add(item); } }
private void InitialCateModel(TopicAjaxModel model, string name, int pageNo) { var topicList = _iTopicService.GetTopics(new IServices.QueryModel.TopicQuery { PageNo = pageNo, PageSize = 10, PlatformType = Core.PlatformType.Mobile, Name = name }); int pageCount = TemplatePageHelper.GetPageCount(topicList.Total, 10); if (topicList != null) { model.status = 1; model.page = TemplatePageHelper.GetPageHtml(pageCount, pageNo); InitialCateContentModel(topicList.Models, model); } }
private void InitialCateModel(TopicAjaxModel model, string name, int pageNo, long shopId) { TopicQuery topicQuery = new TopicQuery { PageNo = pageNo, PageSize = 10, ShopId = shopId, PlatformType = PlatformType.Mobile, Name = name }; QueryPageModel <TopicInfo> topics = this._iTopicService.GetTopics(topicQuery); int pageCount = TemplatePageHelper.GetPageCount(topics.Total, 10); if (topics != null) { model.status = 1; model.page = TemplatePageHelper.GetPageHtml(pageCount, pageNo); this.InitialCateContentModel(topics.Models, model); } }