Beispiel #1
0
        public JsonResult SearchTopic(string topicName, int topicTypeId, int?page, int rows)
        {
            PagingInfo PageInfo = new PagingInfo();

            if (!string.IsNullOrEmpty(topicName))
            {
                topicName = string.Format("%{0}%", topicName);
            }
            PagedResult <Topic> pagedResult = topicBLL.GetTopicList(topicName, topicTypeId, page, rows);

            PageInfo.PageIndex    = page.HasValue ? page.Value - 1 : 0;
            PageInfo.PageSize     = rows;
            PageInfo.TotalRecords = pagedResult.Total;
            var result = new GridResult <Topic>(pagedResult.Result, pagedResult.Total);

            return(new JsonResult(result));
        }