public ExchangeRate(XmlNode xmlNode)
 {
     XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair");
     
     if (quotedCurrencyPairNode != null)
     {
         if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null) 
         {
             if (quotedCurrencyPairNode.Attributes["id"] != null) 
             {
                 quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value;
                 QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode);
                 IDManager.SetID(quotedCurrencyPairIDRef_, ob);
             }
             else if (quotedCurrencyPairNode.Attributes["href"] != null)
             {
                 quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value;
             }
             else
             {
                 quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
             }
         }
         else
         {
             quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
         }
     }
     
 
     XmlNode rateNode = xmlNode.SelectSingleNode("rate");
     
     if (rateNode != null)
     {
         if (rateNode.Attributes["href"] != null || rateNode.Attributes["id"] != null) 
         {
             if (rateNode.Attributes["id"] != null) 
             {
                 rateIDRef_ = rateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(rateNode);
                 IDManager.SetID(rateIDRef_, ob);
             }
             else if (rateNode.Attributes["href"] != null)
             {
                 rateIDRef_ = rateNode.Attributes["href"].Value;
             }
             else
             {
                 rate_ = new PositiveDecimal(rateNode);
             }
         }
         else
         {
             rate_ = new PositiveDecimal(rateNode);
         }
     }
     
 
     XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate");
     
     if (spotRateNode != null)
     {
         if (spotRateNode.Attributes["href"] != null || spotRateNode.Attributes["id"] != null) 
         {
             if (spotRateNode.Attributes["id"] != null) 
             {
                 spotRateIDRef_ = spotRateNode.Attributes["id"].Value;
                 PositiveDecimal ob = new PositiveDecimal(spotRateNode);
                 IDManager.SetID(spotRateIDRef_, ob);
             }
             else if (spotRateNode.Attributes["href"] != null)
             {
                 spotRateIDRef_ = spotRateNode.Attributes["href"].Value;
             }
             else
             {
                 spotRate_ = new PositiveDecimal(spotRateNode);
             }
         }
         else
         {
             spotRate_ = new PositiveDecimal(spotRateNode);
         }
     }
     
 
     XmlNode forwardPointsNode = xmlNode.SelectSingleNode("forwardPoints");
     
     if (forwardPointsNode != null)
     {
         if (forwardPointsNode.Attributes["href"] != null || forwardPointsNode.Attributes["id"] != null) 
         {
             if (forwardPointsNode.Attributes["id"] != null) 
             {
                 forwardPointsIDRef_ = forwardPointsNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(forwardPointsNode);
                 IDManager.SetID(forwardPointsIDRef_, ob);
             }
             else if (forwardPointsNode.Attributes["href"] != null)
             {
                 forwardPointsIDRef_ = forwardPointsNode.Attributes["href"].Value;
             }
             else
             {
                 forwardPoints_ = new XsdTypeDecimal(forwardPointsNode);
             }
         }
         else
         {
             forwardPoints_ = new XsdTypeDecimal(forwardPointsNode);
         }
     }
     
 
     XmlNode pointValueNode = xmlNode.SelectSingleNode("pointValue");
     
     if (pointValueNode != null)
     {
         if (pointValueNode.Attributes["href"] != null || pointValueNode.Attributes["id"] != null) 
         {
             if (pointValueNode.Attributes["id"] != null) 
             {
                 pointValueIDRef_ = pointValueNode.Attributes["id"].Value;
                 PointValue ob = new PointValue(pointValueNode);
                 IDManager.SetID(pointValueIDRef_, ob);
             }
             else if (pointValueNode.Attributes["href"] != null)
             {
                 pointValueIDRef_ = pointValueNode.Attributes["href"].Value;
             }
             else
             {
                 pointValue_ = new PointValue(pointValueNode);
             }
         }
         else
         {
             pointValue_ = new PointValue(pointValueNode);
         }
     }
     
 
     XmlNodeList crossRateNodeList = xmlNode.SelectNodes("crossRate");
     
     if (crossRateNodeList != null)
     {
         this.crossRate_ = new List<CrossRate>();
         foreach (XmlNode item in crossRateNodeList)
         {
             if (item.Attributes["href"] != null || item.Attributes["id"] != null) 
             {
                 if (item.Attributes["id"] != null) 
                 {
                     crossRateIDRef_ = item.Attributes["id"].Value;
                     crossRate_.Add(new CrossRate(item));
                     IDManager.SetID(crossRateIDRef_, crossRate_[crossRate_.Count - 1 ]);
                 }
                 else if (item.Attributes["href"] != null)
                 {
                     crossRateIDRef_ = item.Attributes["href"].Value;
                 }
                 else
                 {
                 crossRate_.Add(new CrossRate(item));
                 }
             }
             else
             {
                 crossRate_.Add(new CrossRate(item));
             }
         }
     }
     
 
 }
        public ExchangeRate(XmlNode xmlNode)
        {
            XmlNode quotedCurrencyPairNode = xmlNode.SelectSingleNode("quotedCurrencyPair");

            if (quotedCurrencyPairNode != null)
            {
                if (quotedCurrencyPairNode.Attributes["href"] != null || quotedCurrencyPairNode.Attributes["id"] != null)
                {
                    if (quotedCurrencyPairNode.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["id"].Value;
                        QuotedCurrencyPair ob = new QuotedCurrencyPair(quotedCurrencyPairNode);
                        IDManager.SetID(quotedCurrencyPairIDRef_, ob);
                    }
                    else if (quotedCurrencyPairNode.Attributes["href"] != null)
                    {
                        quotedCurrencyPairIDRef_ = quotedCurrencyPairNode.Attributes["href"].Value;
                    }
                    else
                    {
                        quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                    }
                }
                else
                {
                    quotedCurrencyPair_ = new QuotedCurrencyPair(quotedCurrencyPairNode);
                }
            }


            XmlNode rateNode = xmlNode.SelectSingleNode("rate");

            if (rateNode != null)
            {
                if (rateNode.Attributes["href"] != null || rateNode.Attributes["id"] != null)
                {
                    if (rateNode.Attributes["id"] != null)
                    {
                        rateIDRef_ = rateNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(rateNode);
                        IDManager.SetID(rateIDRef_, ob);
                    }
                    else if (rateNode.Attributes["href"] != null)
                    {
                        rateIDRef_ = rateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        rate_ = new PositiveDecimal(rateNode);
                    }
                }
                else
                {
                    rate_ = new PositiveDecimal(rateNode);
                }
            }


            XmlNode spotRateNode = xmlNode.SelectSingleNode("spotRate");

            if (spotRateNode != null)
            {
                if (spotRateNode.Attributes["href"] != null || spotRateNode.Attributes["id"] != null)
                {
                    if (spotRateNode.Attributes["id"] != null)
                    {
                        spotRateIDRef_ = spotRateNode.Attributes["id"].Value;
                        PositiveDecimal ob = new PositiveDecimal(spotRateNode);
                        IDManager.SetID(spotRateIDRef_, ob);
                    }
                    else if (spotRateNode.Attributes["href"] != null)
                    {
                        spotRateIDRef_ = spotRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        spotRate_ = new PositiveDecimal(spotRateNode);
                    }
                }
                else
                {
                    spotRate_ = new PositiveDecimal(spotRateNode);
                }
            }


            XmlNode forwardPointsNode = xmlNode.SelectSingleNode("forwardPoints");

            if (forwardPointsNode != null)
            {
                if (forwardPointsNode.Attributes["href"] != null || forwardPointsNode.Attributes["id"] != null)
                {
                    if (forwardPointsNode.Attributes["id"] != null)
                    {
                        forwardPointsIDRef_ = forwardPointsNode.Attributes["id"].Value;
                        XsdTypeDecimal ob = new XsdTypeDecimal(forwardPointsNode);
                        IDManager.SetID(forwardPointsIDRef_, ob);
                    }
                    else if (forwardPointsNode.Attributes["href"] != null)
                    {
                        forwardPointsIDRef_ = forwardPointsNode.Attributes["href"].Value;
                    }
                    else
                    {
                        forwardPoints_ = new XsdTypeDecimal(forwardPointsNode);
                    }
                }
                else
                {
                    forwardPoints_ = new XsdTypeDecimal(forwardPointsNode);
                }
            }


            XmlNode pointValueNode = xmlNode.SelectSingleNode("pointValue");

            if (pointValueNode != null)
            {
                if (pointValueNode.Attributes["href"] != null || pointValueNode.Attributes["id"] != null)
                {
                    if (pointValueNode.Attributes["id"] != null)
                    {
                        pointValueIDRef_ = pointValueNode.Attributes["id"].Value;
                        PointValue ob = new PointValue(pointValueNode);
                        IDManager.SetID(pointValueIDRef_, ob);
                    }
                    else if (pointValueNode.Attributes["href"] != null)
                    {
                        pointValueIDRef_ = pointValueNode.Attributes["href"].Value;
                    }
                    else
                    {
                        pointValue_ = new PointValue(pointValueNode);
                    }
                }
                else
                {
                    pointValue_ = new PointValue(pointValueNode);
                }
            }


            XmlNodeList crossRateNodeList = xmlNode.SelectNodes("crossRate");

            if (crossRateNodeList != null)
            {
                this.crossRate_ = new List <CrossRate>();
                foreach (XmlNode item in crossRateNodeList)
                {
                    if (item.Attributes["href"] != null || item.Attributes["id"] != null)
                    {
                        if (item.Attributes["id"] != null)
                        {
                            crossRateIDRef_ = item.Attributes["id"].Value;
                            crossRate_.Add(new CrossRate(item));
                            IDManager.SetID(crossRateIDRef_, crossRate_[crossRate_.Count - 1]);
                        }
                        else if (item.Attributes["href"] != null)
                        {
                            crossRateIDRef_ = item.Attributes["href"].Value;
                        }
                        else
                        {
                            crossRate_.Add(new CrossRate(item));
                        }
                    }
                    else
                    {
                        crossRate_.Add(new CrossRate(item));
                    }
                }
            }
        }
Example #3
0
        public ExchangeRate(XmlNode xmlNode)
        {
            XmlNodeList quotedCurrencyPairNodeList = xmlNode.SelectNodes("quotedCurrencyPair");

            if (quotedCurrencyPairNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in quotedCurrencyPairNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        quotedCurrencyPairIDRef = item.Attributes["id"].Name;
                        QuotedCurrencyPair ob = QuotedCurrencyPair();
                        IDManager.SetID(quotedCurrencyPairIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        quotedCurrencyPairIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        quotedCurrencyPair = new QuotedCurrencyPair(item);
                    }
                }
            }


            XmlNodeList rateNodeList = xmlNode.SelectNodes("rate");

            if (rateNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in rateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        rateIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(rateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        rateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        rate = new PositiveDecimal(item);
                    }
                }
            }


            XmlNodeList spotRateNodeList = xmlNode.SelectNodes("spotRate");

            if (spotRateNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in spotRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        spotRateIDRef = item.Attributes["id"].Name;
                        PositiveDecimal ob = PositiveDecimal();
                        IDManager.SetID(spotRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        spotRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        spotRate = new PositiveDecimal(item);
                    }
                }
            }


            XmlNodeList forwardPointsNodeList = xmlNode.SelectNodes("forwardPoints");

            if (forwardPointsNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in forwardPointsNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        forwardPointsIDRef = item.Attributes["id"].Name;
                        XsdTypeDecimal ob = XsdTypeDecimal();
                        IDManager.SetID(forwardPointsIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        forwardPointsIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        forwardPoints = new XsdTypeDecimal(item);
                    }
                }
            }


            XmlNodeList pointValueNodeList = xmlNode.SelectNodes("pointValue");

            if (pointValueNodeList.Count > 1)
            {
                throw new Exception();
            }

            foreach (XmlNode item in pointValueNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        pointValueIDRef = item.Attributes["id"].Name;
                        PointValue ob = PointValue();
                        IDManager.SetID(pointValueIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        pointValueIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        pointValue = new PointValue(item);
                    }
                }
            }


            XmlNodeList crossRateNodeList = xmlNode.SelectNodes("crossRate");

            foreach (XmlNode item in crossRateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        crossRateIDRef = item.Attributes["id"].Name;
                        List <CrossRate> ob = new List <CrossRate>();
                        ob.Add(new CrossRate(item));
                        IDManager.SetID(crossRateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        crossRateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        crossRate.Add(new CrossRate(item));
                    }
                }
            }
        }