示例#1
0
        /// <summary>
        /// 获取商品分类
        /// </summary>
        public string GetItemCategoryListData()
        {
            var form = Request("form").DeserializeJSONTo <ItemCategoryQueryEntity>();

            var itemCategoryService  = new ItemCategoryService(CurrentUserInfo);
            ItemCategoryInfo data    = new ItemCategoryInfo();
            string           content = string.Empty;

            string item_category_code = FormatParamValue(form.item_category_code);
            string item_category_name = FormatParamValue(form.item_category_name);
            string pyzjm = FormatParamValue(form.pyzjm);
            string item_category_status = FormatParamValue(Request("item_category_status"));
            string item_category_id     = FormatParamValue(Request("item_category_id"));
            int    maxRowCount          = PageSize;
            int    startRowIndex        = Utils.GetIntVal(Request("start"));

            string key = string.Empty;

            if (Request("item_category_id") != null && Request("item_category_id") != string.Empty)
            {
                key = Request("item_category_id").ToString().Trim();
            }

            data = itemCategoryService.SearchItemCategoryList(
                item_category_code, item_category_name, pyzjm, item_category_status,
                maxRowCount, startRowIndex, item_category_id);

            var jsonData = new JsonData();

            jsonData.totalCount = data.ItemCategoryInfoList.Count.ToString();
            jsonData.data       = data.ItemCategoryInfoList;

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