Ejemplo n.º 1
0
        /// <summary>
        /// 查询标签
        /// </summary>
        public string GetTagsListData()
        {
            var form = Request("form").DeserializeJSONTo <TagsQueryEntity>();

            var tagsBLL = new TagsBLL(CurrentUserInfo);
            IList <TagsEntity> tagsList;
            string             content = string.Empty;

            int pageIndex = Utils.GetIntVal(FormatParamValue(Request("page"))) - 1;

            TagsEntity queryEntity = new TagsEntity();

            queryEntity.TagsName = FormatParamValue(form.TagsName);
            queryEntity.TagsDesc = FormatParamValue(form.TagsDesc);
            queryEntity.TypeId   = FormatParamValue(form.TypeId);
            queryEntity.StatusId = FormatParamValue(form.StatusId);

            tagsList = tagsBLL.GetWebTags(queryEntity, pageIndex, PageSize);
            var dataTotalCount = tagsBLL.GetWebTagsCount(queryEntity);

            var jsonData = new JsonData();

            jsonData.totalCount = dataTotalCount.ToString();
            jsonData.data       = tagsList;

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    jsonData.data.ToJSON(),
                                    jsonData.totalCount);
            return(content);
        }