Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public List <Product_Class> GetCategories(BUser user)
        {
            List <Product_Class>     categories = new List <Product_Class>();
            SellercatsListGetRequest req        = new SellercatsListGetRequest();

            req.Nick = user.Mall_Name;
            SellercatsListGetResponse response = client.Execute(req);

            if (response.IsError)
            {
                throw new KMJXCException(response.ErrMsg);
            }

            if (response.SellerCats != null)
            {
                foreach (TB.SellerCat cat in response.SellerCats)
                {
                    Product_Class category = new Product_Class();
                    category.Create_Time      = DateTimeUtil.ConvertDateTimeToInt(DateTime.Now);
                    category.Create_User_ID   = user.ID;
                    category.Enabled          = true;
                    category.Mall_CID         = cat.Cid.ToString();
                    category.Mall_PCID        = cat.ParentCid.ToString();
                    category.Name             = cat.Name;
                    category.Parent_ID        = 0;
                    category.Product_Class_ID = 0;
                    categories.Add(category);
                }
            }
            return(categories);
        }
Example #2
0
        /// <summary>
        /// 获取前台展示的店铺内卖家自定义商品类目
        /// </summary>
        /// <param name="NickName"></param>
        internal List <SellerCat> GetSPLM(string NickName)
        {
            ITopClient client            = new DefaultTopClient(StaticSystemConfig.soft.ApiURL, StaticSystemConfig.soft.AppKey, StaticSystemConfig.soft.AppSecret, "json");
            SellercatsListGetRequest req = new SellercatsListGetRequest();

            req.Nick = NickName;
            SellercatsListGetResponse  response = client.Execute(req);
            TopJsonParser              topjson  = new TopJsonParser();
            SellercatsListGetResponse1 resp     = topjson.Parse <SellercatsListGetResponse1>(response.Body);

            return(resp.SellerCats);
        }
Example #3
0
        ////店铺API,taobao.sellercats.list.get; 获取卖家自己的产品类目
        /// <summary>
        ///     店铺API,taobao.sellercats.list.get; 获取卖家自己的产品类目
        /// </summary>
        /// <param name="userNick">淘宝昵称</param>
        public List <SellerCat> GetSellercatsList(string userNick)
        {
            if (string.IsNullOrEmpty(userNick))
            {
                throw new Exception(Resource.ExceptionTemplate_MethedParameterIsNullorEmpty
                                    .StringFormat(new StackTrace().ToString()));
            }

            var reqCats = new SellercatsListGetRequest {
                Nick = userNick
            };
            SellercatsListGetResponse responseCats = client.Execute(reqCats);

            return(responseCats.SellerCats);
        }