Esempio n. 1
0
        public static string GetDataByKuaidi100(string computer, string expressNo)
        {
            string      key      = "29833628d495d7a5";
            string      text     = "";
            XmlDocument xmlNode  = ExpressHelper.GetXmlNode();
            XmlNode     xmlNode2 = xmlNode.SelectSingleNode("companys");
            string      str      = "{\"message\": \"ok\",\"content\": ";

            if (xmlNode2 != null)
            {
                text = xmlNode2.Attributes["Kuaidi100NewKey"].Value;
            }
            if (!string.IsNullOrEmpty(text))
            {
                string expressDataList = new ExpressDataDao().GetExpressDataList(computer, expressNo);
                if (!string.IsNullOrEmpty(expressDataList))
                {
                    str += expressDataList;
                    str += ",\"type\":\"1\"";
                }
                else
                {
                    str += ExpressHelper.GetContentByAPI(text, computer, expressNo);
                    str += ",\"type\":\"2\"";
                }
            }
            else
            {
                str += ExpressHelper.GetContentByAPI(key, computer, expressNo);
                str += ",\"type\":\"2\"";
            }
            return(str + "}");
        }
Esempio n. 2
0
        public static string GetDataByKuaidi100(string computer, string expressNo)
        {
            string  key  = "29833628d495d7a5";
            string  str2 = "";
            XmlNode node = GetXmlNode().SelectSingleNode("companys");
            string  str3 = "{\"message\": \"ok\",\"content\": ";

            if (node != null)
            {
                str2 = node.Attributes["Kuaidi100NewKey"].Value;
            }
            if (!string.IsNullOrEmpty(str2))
            {
                string expressDataList = new ExpressDataDao().GetExpressDataList(computer, expressNo);
                if (!string.IsNullOrEmpty(expressDataList))
                {
                    str3 = str3 + expressDataList + ",\"type\":\"1\"";
                }
                else
                {
                    str3 = str3 + GetContentByAPI(str2, computer, expressNo) + ",\"type\":\"2\"";
                }
            }
            else
            {
                str3 = str3 + GetContentByAPI(key, computer, expressNo) + ",\"type\":\"2\"";
            }
            return(str3 + "}");
        }