示例#1
0
        public ActualPrice(XmlNode xmlNode)
        {
            XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency");

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

            foreach (XmlNode item in currencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        currencyIDRef = item.Attributes["id"].Name;
                        Currency ob = Currency();
                        IDManager.SetID(currencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        currencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        currency = new Currency(item);
                    }
                }
            }


            XmlNodeList amountNodeList = xmlNode.SelectNodes("amount");

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

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


            XmlNodeList priceExpressionNodeList = xmlNode.SelectNodes("priceExpression");

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

            foreach (XmlNode item in priceExpressionNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        priceExpressionIDRef = item.Attributes["id"].Name;
                        PriceExpressionEnum ob = PriceExpressionEnum();
                        IDManager.SetID(priceExpressionIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        priceExpressionIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        priceExpression = new PriceExpressionEnum(item);
                    }
                }
            }
        }
 public ActualPrice(XmlNode xmlNode)
 {
     XmlNode currencyNode = xmlNode.SelectSingleNode("currency");
     
     if (currencyNode != null)
     {
         if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) 
         {
             if (currencyNode.Attributes["id"] != null) 
             {
                 currencyIDRef_ = currencyNode.Attributes["id"].Value;
                 Currency ob = new Currency(currencyNode);
                 IDManager.SetID(currencyIDRef_, ob);
             }
             else if (currencyNode.Attributes["href"] != null)
             {
                 currencyIDRef_ = currencyNode.Attributes["href"].Value;
             }
             else
             {
                 currency_ = new Currency(currencyNode);
             }
         }
         else
         {
             currency_ = new Currency(currencyNode);
         }
     }
     
 
     XmlNode amountNode = xmlNode.SelectSingleNode("amount");
     
     if (amountNode != null)
     {
         if (amountNode.Attributes["href"] != null || amountNode.Attributes["id"] != null) 
         {
             if (amountNode.Attributes["id"] != null) 
             {
                 amountIDRef_ = amountNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(amountNode);
                 IDManager.SetID(amountIDRef_, ob);
             }
             else if (amountNode.Attributes["href"] != null)
             {
                 amountIDRef_ = amountNode.Attributes["href"].Value;
             }
             else
             {
                 amount_ = new XsdTypeDecimal(amountNode);
             }
         }
         else
         {
             amount_ = new XsdTypeDecimal(amountNode);
         }
     }
     
 
     XmlNode priceExpressionNode = xmlNode.SelectSingleNode("priceExpression");
     
     if (priceExpressionNode != null)
     {
         if (priceExpressionNode.Attributes["href"] != null || priceExpressionNode.Attributes["id"] != null) 
         {
             if (priceExpressionNode.Attributes["id"] != null) 
             {
                 priceExpressionIDRef_ = priceExpressionNode.Attributes["id"].Value;
                 PriceExpressionEnum ob = new PriceExpressionEnum(priceExpressionNode);
                 IDManager.SetID(priceExpressionIDRef_, ob);
             }
             else if (priceExpressionNode.Attributes["href"] != null)
             {
                 priceExpressionIDRef_ = priceExpressionNode.Attributes["href"].Value;
             }
             else
             {
                 priceExpression_ = new PriceExpressionEnum(priceExpressionNode);
             }
         }
         else
         {
             priceExpression_ = new PriceExpressionEnum(priceExpressionNode);
         }
     }
     
 
 }
示例#3
0
        public ActualPrice(XmlNode xmlNode)
        {
            XmlNode currencyNode = xmlNode.SelectSingleNode("currency");

            if (currencyNode != null)
            {
                if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null)
                {
                    if (currencyNode.Attributes["id"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["id"].Value;
                        Currency ob = new Currency(currencyNode);
                        IDManager.SetID(currencyIDRef_, ob);
                    }
                    else if (currencyNode.Attributes["href"] != null)
                    {
                        currencyIDRef_ = currencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        currency_ = new Currency(currencyNode);
                    }
                }
                else
                {
                    currency_ = new Currency(currencyNode);
                }
            }


            XmlNode amountNode = xmlNode.SelectSingleNode("amount");

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


            XmlNode priceExpressionNode = xmlNode.SelectSingleNode("priceExpression");

            if (priceExpressionNode != null)
            {
                if (priceExpressionNode.Attributes["href"] != null || priceExpressionNode.Attributes["id"] != null)
                {
                    if (priceExpressionNode.Attributes["id"] != null)
                    {
                        priceExpressionIDRef_ = priceExpressionNode.Attributes["id"].Value;
                        PriceExpressionEnum ob = new PriceExpressionEnum(priceExpressionNode);
                        IDManager.SetID(priceExpressionIDRef_, ob);
                    }
                    else if (priceExpressionNode.Attributes["href"] != null)
                    {
                        priceExpressionIDRef_ = priceExpressionNode.Attributes["href"].Value;
                    }
                    else
                    {
                        priceExpression_ = new PriceExpressionEnum(priceExpressionNode);
                    }
                }
                else
                {
                    priceExpression_ = new PriceExpressionEnum(priceExpressionNode);
                }
            }
        }