public static List<string> GetOffers(int iWebsiteID) { PASConnect oConn = new PASConnect(); XmlDocument xmlWrapper = oConn.SendRequest("/website_offers.xml", "GET", null, "&website_id=" + iWebsiteID.ToString()); List<string> lst = new List<string>(); foreach (XmlNode xn in xmlWrapper.SelectNodes("//offer")) { lst.Add(xn.InnerXml); } return lst; }
/// <summary> /// Static method. Return member object matching the login name, or null if no matches (or multiple matches) on name. /// </summary> public static PASMember GetMemberByLogin(string sLogin) { PASConnect oConn = new PASConnect(); XmlDocument xmlMembers = oConn.SendRequest("/publisher_members.xml", "GET", null, "&search[order]=&criteria_0=login&operator_0=equals&query_0=" + sLogin); XmlNode xmlWrapper = xmlMembers.SelectSingleNode("//members"); if (xmlWrapper.Attributes["total_entries"].InnerText == "1") { // int.Parse should never fail here. if it does, exception is appropriate. return new PASMember(int.Parse(xmlWrapper["member"]["id"].InnerText)); } else { return null; } }