static public int GetCurrencyID(String CurrencyCode) { if (CurrencyCode.Length == 0) { return(0); } int tmpS = 0; XmlNode n = RatesDoc.SelectSingleNode("//Currency[@CurrencyCode=" + CommonLogic.SQuote(CurrencyCode) + "]"); if (n != null) { tmpS = XmlCommon.XmlAttributeNativeInt(n, "CurrencyID"); } return(tmpS); }
static public ArrayList getCurrencyList() { ArrayList list = new ArrayList(); foreach (XmlNode n in RatesDoc.SelectNodes("//Currency[@Published = 1]")) { int cID = XmlCommon.XmlAttributeNativeInt(n, "CurrencyID"); string cc = XmlCommon.XmlAttribute(n, "CurrencyCode"); string cn = XmlCommon.XmlAttribute(n, "Name"); ListItemClass item = new ListItemClass(); item.Item = cc + " (" + cn + ")"; item.Value = cID; list.Add(item); } return(list); }
static public IEnumerable <CurrencyInfo> GetCurrencies() { return(RatesDoc .SelectNodes("//Currency[@Published = 1]") .OfType <XmlNode>() .Select(node => new CurrencyInfo( currencyId: XmlCommon.XmlAttributeNativeInt(node, "CurrencyID"), currencyGuid: Guid.Parse(XmlCommon.XmlAttribute(node, "CurrencyGUID")), name: XmlCommon.XmlAttribute(node, "Name"), currencyCode: XmlCommon.XmlAttribute(node, "CurrencyCode"), exchangeRate: XmlCommon.XmlAttributeNativeDecimal(node, "ExchangeRate"), wasLiveRate: XmlCommon.XmlAttributeBool(node, "WasLiveRate"), displayLocaleFormat: XmlCommon.XmlAttribute(node, "DisplayLocaleFormat"), symbol: XmlCommon.XmlAttribute(node, "Symbol"), extensionData: XmlCommon.XmlAttribute(node, "ExtensionData"), published: XmlCommon.XmlAttributeBool(node, "Published"), displayOrder: XmlCommon.XmlAttributeNativeInt(node, "DisplayOrder"), displaySpec: XmlCommon.XmlAttribute(node, "DisplaySpec"), lastUpdated: XmlCommon.XmlAttributeNativeDateTime(node, "LastUpdated"), createdOn: XmlCommon.XmlAttributeNativeDateTime(node, "CreatedOn"), updatedOn: XmlCommon.XmlAttributeNativeDateTime(node, "UpdatedOn")))); }