Exemplo n.º 1
0
        public NotionalStepRule(XmlNode xmlNode)
        {
            XmlNodeList calculationPeriodDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodDatesReference");

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

            foreach (XmlNode item in calculationPeriodDatesReferenceNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef = item.Attributes["id"].Name;
                        CalculationPeriodDatesReference ob = CalculationPeriodDatesReference();
                        IDManager.SetID(calculationPeriodDatesReferenceIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        calculationPeriodDatesReferenceIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        calculationPeriodDatesReference = new CalculationPeriodDatesReference(item);
                    }
                }
            }


            XmlNodeList stepFrequencyNodeList = xmlNode.SelectNodes("stepFrequency");

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

            foreach (XmlNode item in stepFrequencyNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        stepFrequencyIDRef = item.Attributes["id"].Name;
                        Period ob = Period();
                        IDManager.SetID(stepFrequencyIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        stepFrequencyIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        stepFrequency = new Period(item);
                    }
                }
            }


            XmlNodeList firstNotionalStepDateNodeList = xmlNode.SelectNodes("firstNotionalStepDate");

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

            foreach (XmlNode item in firstNotionalStepDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        firstNotionalStepDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(firstNotionalStepDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        firstNotionalStepDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        firstNotionalStepDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList lastNotionalStepDateNodeList = xmlNode.SelectNodes("lastNotionalStepDate");

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

            foreach (XmlNode item in lastNotionalStepDateNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        lastNotionalStepDateIDRef = item.Attributes["id"].Name;
                        XsdTypeDate ob = XsdTypeDate();
                        IDManager.SetID(lastNotionalStepDateIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        lastNotionalStepDateIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        lastNotionalStepDate = new XsdTypeDate(item);
                    }
                }
            }


            XmlNodeList notionalStepAmountNodeList = xmlNode.SelectNodes("notionalStepAmount");

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

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


            XmlNodeList notionalStepRateNodeList = xmlNode.SelectNodes("notionalStepRate");

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

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


            XmlNodeList stepRelativeToNodeList = xmlNode.SelectNodes("stepRelativeTo");

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

            foreach (XmlNode item in stepRelativeToNodeList)
            {
                if (item.Attributes["href"] != null || item.Attributes["id"] == null)
                {
                    if (item.Attributes["id"] != null)
                    {
                        stepRelativeToIDRef = item.Attributes["id"].Name;
                        StepRelativeToEnum ob = StepRelativeToEnum();
                        IDManager.SetID(stepRelativeToIDRef, ob);
                    }
                    else if (item.Attributes.ToString() == "href")
                    {
                        stepRelativeToIDRef = item.Attributes["href"].Name;
                    }
                    else
                    {
                        stepRelativeTo = new StepRelativeToEnum(item);
                    }
                }
            }
        }
 public NotionalStepRule(XmlNode xmlNode)
 {
     XmlNode calculationPeriodDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodDatesReference");
     
     if (calculationPeriodDatesReferenceNode != null)
     {
         if (calculationPeriodDatesReferenceNode.Attributes["href"] != null || calculationPeriodDatesReferenceNode.Attributes["id"] != null) 
         {
             if (calculationPeriodDatesReferenceNode.Attributes["id"] != null) 
             {
                 calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["id"].Value;
                 CalculationPeriodDatesReference ob = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                 IDManager.SetID(calculationPeriodDatesReferenceIDRef_, ob);
             }
             else if (calculationPeriodDatesReferenceNode.Attributes["href"] != null)
             {
                 calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["href"].Value;
             }
             else
             {
                 calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
             }
         }
         else
         {
             calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
         }
     }
     
 
     XmlNode stepFrequencyNode = xmlNode.SelectSingleNode("stepFrequency");
     
     if (stepFrequencyNode != null)
     {
         if (stepFrequencyNode.Attributes["href"] != null || stepFrequencyNode.Attributes["id"] != null) 
         {
             if (stepFrequencyNode.Attributes["id"] != null) 
             {
                 stepFrequencyIDRef_ = stepFrequencyNode.Attributes["id"].Value;
                 Period ob = new Period(stepFrequencyNode);
                 IDManager.SetID(stepFrequencyIDRef_, ob);
             }
             else if (stepFrequencyNode.Attributes["href"] != null)
             {
                 stepFrequencyIDRef_ = stepFrequencyNode.Attributes["href"].Value;
             }
             else
             {
                 stepFrequency_ = new Period(stepFrequencyNode);
             }
         }
         else
         {
             stepFrequency_ = new Period(stepFrequencyNode);
         }
     }
     
 
     XmlNode firstNotionalStepDateNode = xmlNode.SelectSingleNode("firstNotionalStepDate");
     
     if (firstNotionalStepDateNode != null)
     {
         if (firstNotionalStepDateNode.Attributes["href"] != null || firstNotionalStepDateNode.Attributes["id"] != null) 
         {
             if (firstNotionalStepDateNode.Attributes["id"] != null) 
             {
                 firstNotionalStepDateIDRef_ = firstNotionalStepDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(firstNotionalStepDateNode);
                 IDManager.SetID(firstNotionalStepDateIDRef_, ob);
             }
             else if (firstNotionalStepDateNode.Attributes["href"] != null)
             {
                 firstNotionalStepDateIDRef_ = firstNotionalStepDateNode.Attributes["href"].Value;
             }
             else
             {
                 firstNotionalStepDate_ = new XsdTypeDate(firstNotionalStepDateNode);
             }
         }
         else
         {
             firstNotionalStepDate_ = new XsdTypeDate(firstNotionalStepDateNode);
         }
     }
     
 
     XmlNode lastNotionalStepDateNode = xmlNode.SelectSingleNode("lastNotionalStepDate");
     
     if (lastNotionalStepDateNode != null)
     {
         if (lastNotionalStepDateNode.Attributes["href"] != null || lastNotionalStepDateNode.Attributes["id"] != null) 
         {
             if (lastNotionalStepDateNode.Attributes["id"] != null) 
             {
                 lastNotionalStepDateIDRef_ = lastNotionalStepDateNode.Attributes["id"].Value;
                 XsdTypeDate ob = new XsdTypeDate(lastNotionalStepDateNode);
                 IDManager.SetID(lastNotionalStepDateIDRef_, ob);
             }
             else if (lastNotionalStepDateNode.Attributes["href"] != null)
             {
                 lastNotionalStepDateIDRef_ = lastNotionalStepDateNode.Attributes["href"].Value;
             }
             else
             {
                 lastNotionalStepDate_ = new XsdTypeDate(lastNotionalStepDateNode);
             }
         }
         else
         {
             lastNotionalStepDate_ = new XsdTypeDate(lastNotionalStepDateNode);
         }
     }
     
 
     XmlNode notionalStepAmountNode = xmlNode.SelectSingleNode("notionalStepAmount");
     
     if (notionalStepAmountNode != null)
     {
         if (notionalStepAmountNode.Attributes["href"] != null || notionalStepAmountNode.Attributes["id"] != null) 
         {
             if (notionalStepAmountNode.Attributes["id"] != null) 
             {
                 notionalStepAmountIDRef_ = notionalStepAmountNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(notionalStepAmountNode);
                 IDManager.SetID(notionalStepAmountIDRef_, ob);
             }
             else if (notionalStepAmountNode.Attributes["href"] != null)
             {
                 notionalStepAmountIDRef_ = notionalStepAmountNode.Attributes["href"].Value;
             }
             else
             {
                 notionalStepAmount_ = new XsdTypeDecimal(notionalStepAmountNode);
             }
         }
         else
         {
             notionalStepAmount_ = new XsdTypeDecimal(notionalStepAmountNode);
         }
     }
     
 
     XmlNode notionalStepRateNode = xmlNode.SelectSingleNode("notionalStepRate");
     
     if (notionalStepRateNode != null)
     {
         if (notionalStepRateNode.Attributes["href"] != null || notionalStepRateNode.Attributes["id"] != null) 
         {
             if (notionalStepRateNode.Attributes["id"] != null) 
             {
                 notionalStepRateIDRef_ = notionalStepRateNode.Attributes["id"].Value;
                 XsdTypeDecimal ob = new XsdTypeDecimal(notionalStepRateNode);
                 IDManager.SetID(notionalStepRateIDRef_, ob);
             }
             else if (notionalStepRateNode.Attributes["href"] != null)
             {
                 notionalStepRateIDRef_ = notionalStepRateNode.Attributes["href"].Value;
             }
             else
             {
                 notionalStepRate_ = new XsdTypeDecimal(notionalStepRateNode);
             }
         }
         else
         {
             notionalStepRate_ = new XsdTypeDecimal(notionalStepRateNode);
         }
     }
     
 
     XmlNode stepRelativeToNode = xmlNode.SelectSingleNode("stepRelativeTo");
     
     if (stepRelativeToNode != null)
     {
         if (stepRelativeToNode.Attributes["href"] != null || stepRelativeToNode.Attributes["id"] != null) 
         {
             if (stepRelativeToNode.Attributes["id"] != null) 
             {
                 stepRelativeToIDRef_ = stepRelativeToNode.Attributes["id"].Value;
                 StepRelativeToEnum ob = new StepRelativeToEnum(stepRelativeToNode);
                 IDManager.SetID(stepRelativeToIDRef_, ob);
             }
             else if (stepRelativeToNode.Attributes["href"] != null)
             {
                 stepRelativeToIDRef_ = stepRelativeToNode.Attributes["href"].Value;
             }
             else
             {
                 stepRelativeTo_ = new StepRelativeToEnum(stepRelativeToNode);
             }
         }
         else
         {
             stepRelativeTo_ = new StepRelativeToEnum(stepRelativeToNode);
         }
     }
     
 
 }
        public NotionalStepRule(XmlNode xmlNode)
        {
            XmlNode calculationPeriodDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodDatesReference");

            if (calculationPeriodDatesReferenceNode != null)
            {
                if (calculationPeriodDatesReferenceNode.Attributes["href"] != null || calculationPeriodDatesReferenceNode.Attributes["id"] != null)
                {
                    if (calculationPeriodDatesReferenceNode.Attributes["id"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["id"].Value;
                        CalculationPeriodDatesReference ob = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                        IDManager.SetID(calculationPeriodDatesReferenceIDRef_, ob);
                    }
                    else if (calculationPeriodDatesReferenceNode.Attributes["href"] != null)
                    {
                        calculationPeriodDatesReferenceIDRef_ = calculationPeriodDatesReferenceNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                    }
                }
                else
                {
                    calculationPeriodDatesReference_ = new CalculationPeriodDatesReference(calculationPeriodDatesReferenceNode);
                }
            }


            XmlNode stepFrequencyNode = xmlNode.SelectSingleNode("stepFrequency");

            if (stepFrequencyNode != null)
            {
                if (stepFrequencyNode.Attributes["href"] != null || stepFrequencyNode.Attributes["id"] != null)
                {
                    if (stepFrequencyNode.Attributes["id"] != null)
                    {
                        stepFrequencyIDRef_ = stepFrequencyNode.Attributes["id"].Value;
                        Period ob = new Period(stepFrequencyNode);
                        IDManager.SetID(stepFrequencyIDRef_, ob);
                    }
                    else if (stepFrequencyNode.Attributes["href"] != null)
                    {
                        stepFrequencyIDRef_ = stepFrequencyNode.Attributes["href"].Value;
                    }
                    else
                    {
                        stepFrequency_ = new Period(stepFrequencyNode);
                    }
                }
                else
                {
                    stepFrequency_ = new Period(stepFrequencyNode);
                }
            }


            XmlNode firstNotionalStepDateNode = xmlNode.SelectSingleNode("firstNotionalStepDate");

            if (firstNotionalStepDateNode != null)
            {
                if (firstNotionalStepDateNode.Attributes["href"] != null || firstNotionalStepDateNode.Attributes["id"] != null)
                {
                    if (firstNotionalStepDateNode.Attributes["id"] != null)
                    {
                        firstNotionalStepDateIDRef_ = firstNotionalStepDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(firstNotionalStepDateNode);
                        IDManager.SetID(firstNotionalStepDateIDRef_, ob);
                    }
                    else if (firstNotionalStepDateNode.Attributes["href"] != null)
                    {
                        firstNotionalStepDateIDRef_ = firstNotionalStepDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        firstNotionalStepDate_ = new XsdTypeDate(firstNotionalStepDateNode);
                    }
                }
                else
                {
                    firstNotionalStepDate_ = new XsdTypeDate(firstNotionalStepDateNode);
                }
            }


            XmlNode lastNotionalStepDateNode = xmlNode.SelectSingleNode("lastNotionalStepDate");

            if (lastNotionalStepDateNode != null)
            {
                if (lastNotionalStepDateNode.Attributes["href"] != null || lastNotionalStepDateNode.Attributes["id"] != null)
                {
                    if (lastNotionalStepDateNode.Attributes["id"] != null)
                    {
                        lastNotionalStepDateIDRef_ = lastNotionalStepDateNode.Attributes["id"].Value;
                        XsdTypeDate ob = new XsdTypeDate(lastNotionalStepDateNode);
                        IDManager.SetID(lastNotionalStepDateIDRef_, ob);
                    }
                    else if (lastNotionalStepDateNode.Attributes["href"] != null)
                    {
                        lastNotionalStepDateIDRef_ = lastNotionalStepDateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        lastNotionalStepDate_ = new XsdTypeDate(lastNotionalStepDateNode);
                    }
                }
                else
                {
                    lastNotionalStepDate_ = new XsdTypeDate(lastNotionalStepDateNode);
                }
            }


            XmlNode notionalStepAmountNode = xmlNode.SelectSingleNode("notionalStepAmount");

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


            XmlNode notionalStepRateNode = xmlNode.SelectSingleNode("notionalStepRate");

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


            XmlNode stepRelativeToNode = xmlNode.SelectSingleNode("stepRelativeTo");

            if (stepRelativeToNode != null)
            {
                if (stepRelativeToNode.Attributes["href"] != null || stepRelativeToNode.Attributes["id"] != null)
                {
                    if (stepRelativeToNode.Attributes["id"] != null)
                    {
                        stepRelativeToIDRef_ = stepRelativeToNode.Attributes["id"].Value;
                        StepRelativeToEnum ob = new StepRelativeToEnum(stepRelativeToNode);
                        IDManager.SetID(stepRelativeToIDRef_, ob);
                    }
                    else if (stepRelativeToNode.Attributes["href"] != null)
                    {
                        stepRelativeToIDRef_ = stepRelativeToNode.Attributes["href"].Value;
                    }
                    else
                    {
                        stepRelativeTo_ = new StepRelativeToEnum(stepRelativeToNode);
                    }
                }
                else
                {
                    stepRelativeTo_ = new StepRelativeToEnum(stepRelativeToNode);
                }
            }
        }