public Discounting(XmlNode xmlNode) { XmlNode discountingTypeNode = xmlNode.SelectSingleNode("discountingType"); if (discountingTypeNode != null) { if (discountingTypeNode.Attributes["href"] != null || discountingTypeNode.Attributes["id"] != null) { if (discountingTypeNode.Attributes["id"] != null) { discountingTypeIDRef_ = discountingTypeNode.Attributes["id"].Value; DiscountingTypeEnum ob = new DiscountingTypeEnum(discountingTypeNode); IDManager.SetID(discountingTypeIDRef_, ob); } else if (discountingTypeNode.Attributes["href"] != null) { discountingTypeIDRef_ = discountingTypeNode.Attributes["href"].Value; } else { discountingType_ = new DiscountingTypeEnum(discountingTypeNode); } } else { discountingType_ = new DiscountingTypeEnum(discountingTypeNode); } } XmlNode discountRateNode = xmlNode.SelectSingleNode("discountRate"); if (discountRateNode != null) { if (discountRateNode.Attributes["href"] != null || discountRateNode.Attributes["id"] != null) { if (discountRateNode.Attributes["id"] != null) { discountRateIDRef_ = discountRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(discountRateNode); IDManager.SetID(discountRateIDRef_, ob); } else if (discountRateNode.Attributes["href"] != null) { discountRateIDRef_ = discountRateNode.Attributes["href"].Value; } else { discountRate_ = new XsdTypeDecimal(discountRateNode); } } else { discountRate_ = new XsdTypeDecimal(discountRateNode); } } XmlNode discountRateDayCountFractionNode = xmlNode.SelectSingleNode("discountRateDayCountFraction"); if (discountRateDayCountFractionNode != null) { if (discountRateDayCountFractionNode.Attributes["href"] != null || discountRateDayCountFractionNode.Attributes["id"] != null) { if (discountRateDayCountFractionNode.Attributes["id"] != null) { discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["id"].Value; DayCountFraction ob = new DayCountFraction(discountRateDayCountFractionNode); IDManager.SetID(discountRateDayCountFractionIDRef_, ob); } else if (discountRateDayCountFractionNode.Attributes["href"] != null) { discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["href"].Value; } else { discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode); } } else { discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode); } } }
public Discounting(XmlNode xmlNode) { XmlNodeList discountingTypeNodeList = xmlNode.SelectNodes("discountingType"); if (discountingTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discountingTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountingTypeIDRef = item.Attributes["id"].Name; DiscountingTypeEnum ob = DiscountingTypeEnum(); IDManager.SetID(discountingTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountingTypeIDRef = item.Attributes["href"].Name; } else { discountingType = new DiscountingTypeEnum(item); } } } XmlNodeList discountRateNodeList = xmlNode.SelectNodes("discountRate"); if (discountRateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discountRateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountRateIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(discountRateIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountRateIDRef = item.Attributes["href"].Name; } else { discountRate = new XsdTypeDecimal(item); } } } XmlNodeList discountRateDayCountFractionNodeList = xmlNode.SelectNodes("discountRateDayCountFraction"); if (discountRateDayCountFractionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in discountRateDayCountFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { discountRateDayCountFractionIDRef = item.Attributes["id"].Name; DayCountFraction ob = DayCountFraction(); IDManager.SetID(discountRateDayCountFractionIDRef, ob); } else if (item.Attributes.ToString() == "href") { discountRateDayCountFractionIDRef = item.Attributes["href"].Name; } else { discountRateDayCountFraction = new DayCountFraction(item); } } } }
public Discounting(XmlNode xmlNode) { XmlNode discountingTypeNode = xmlNode.SelectSingleNode("discountingType"); if (discountingTypeNode != null) { if (discountingTypeNode.Attributes["href"] != null || discountingTypeNode.Attributes["id"] != null) { if (discountingTypeNode.Attributes["id"] != null) { discountingTypeIDRef_ = discountingTypeNode.Attributes["id"].Value; DiscountingTypeEnum ob = new DiscountingTypeEnum(discountingTypeNode); IDManager.SetID(discountingTypeIDRef_, ob); } else if (discountingTypeNode.Attributes["href"] != null) { discountingTypeIDRef_ = discountingTypeNode.Attributes["href"].Value; } else { discountingType_ = new DiscountingTypeEnum(discountingTypeNode); } } else { discountingType_ = new DiscountingTypeEnum(discountingTypeNode); } } XmlNode discountRateNode = xmlNode.SelectSingleNode("discountRate"); if (discountRateNode != null) { if (discountRateNode.Attributes["href"] != null || discountRateNode.Attributes["id"] != null) { if (discountRateNode.Attributes["id"] != null) { discountRateIDRef_ = discountRateNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(discountRateNode); IDManager.SetID(discountRateIDRef_, ob); } else if (discountRateNode.Attributes["href"] != null) { discountRateIDRef_ = discountRateNode.Attributes["href"].Value; } else { discountRate_ = new XsdTypeDecimal(discountRateNode); } } else { discountRate_ = new XsdTypeDecimal(discountRateNode); } } XmlNode discountRateDayCountFractionNode = xmlNode.SelectSingleNode("discountRateDayCountFraction"); if (discountRateDayCountFractionNode != null) { if (discountRateDayCountFractionNode.Attributes["href"] != null || discountRateDayCountFractionNode.Attributes["id"] != null) { if (discountRateDayCountFractionNode.Attributes["id"] != null) { discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["id"].Value; DayCountFraction ob = new DayCountFraction(discountRateDayCountFractionNode); IDManager.SetID(discountRateDayCountFractionIDRef_, ob); } else if (discountRateDayCountFractionNode.Attributes["href"] != null) { discountRateDayCountFractionIDRef_ = discountRateDayCountFractionNode.Attributes["href"].Value; } else { discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode); } } else { discountRateDayCountFraction_ = new DayCountFraction(discountRateDayCountFractionNode); } } }