public static PaipaiManager GetInstance() { if (_instance == null) { _instance = new PaipaiManager(); } return(_instance); }
public static PaipaiManager GetInstance() { if (_instance == null) { _instance = new PaipaiManager(); } return _instance; }
public string ResponseFromPaiPai(string response, int productsysno) { XmlDocument xml = new XmlDocument(); xml.Load(new System.IO.MemoryStream(System.Text.Encoding.GetEncoding("GB2312").GetBytes(response))); XmlNodeList xmlnode = xml.SelectSingleNode("response").ChildNodes; string result = ""; string itemid = ""; int retcode = -1; string errinfo = ""; foreach (XmlNode xNo in xmlnode) { if (xNo.Name == "body" || xNo.Name == "head") { foreach (XmlNode xNoChild in xNo.ChildNodes) { XmlElement xe = (XmlElement)xNoChild; { if (xe.Name == "itemid") { itemid = xe.InnerText; PaipaiResponseInfo oPaipaiResponse = new PaipaiResponseInfo(); oPaipaiResponse.ProductSysNo = productsysno; oPaipaiResponse.PaipaiItemID = itemid; oPaipaiResponse.CreateTime = DateTime.Now; PaipaiManager.GetInstance().Insert(oPaipaiResponse); } else if (xe.Name == "retcode") { retcode = Int32.Parse(xe.InnerText); } else if (xe.Name == "errinfo") { errinfo = xe.InnerText; } } } } } if (retcode == 0) { result = "拍拍网上架/更新成功!"; } else { result = "拍拍网更新出错" + errinfo; } return(result); }