Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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"))));
 }