Example #1
0
        /// <summary>
        /// 获取商品价格
        /// </summary>
        /// <param name="skuId"></param>
        /// <returns></returns>
        public static string GetPrice(string skuId)
        {
            string objson = null;

            try
            {
                string  token    = JdHelper.GetToken();
                string  postData = "token=" + token + "&sku=" + skuId;
                string  jsonstr  = WebRequestHelper.SendPostInfo(UrlBase + "price/getPrice", postData);
                JObject objwlgs  = JObject.Parse(jsonstr);
                if (objwlgs["success"].ToString() == "True")
                {
                }
            }
            catch (Exception)
            {
                objson = null;
            }
            return(objson);
        }
Example #2
0
        /// <summary>
        /// 判断是否存在skuId
        /// </summary>
        /// <param name="skuId"></param>
        /// <returns></returns>
        public static bool IscheckskuId(string skuId)
        {
            bool flag = false;

            try
            {
                string  token    = JdHelper.GetToken();
                string  postData = "token=" + token + "&sku=" + skuId;
                string  jsonstr  = WebRequestHelper.SendPostInfo(UrlBase + "price/getPrice", postData);
                JObject objwlgs  = JObject.Parse(jsonstr);
                if (objwlgs["success"].ToString() == "True")
                {
                    flag = true;
                }
            }
            catch (Exception)
            {
                flag = false;
            }
            return(flag);
        }