public CommodityRelativePaymentDates(XmlNode xmlNode) { XmlNode payRelativeToNode = xmlNode.SelectSingleNode("payRelativeTo"); if (payRelativeToNode != null) { if (payRelativeToNode.Attributes["href"] != null || payRelativeToNode.Attributes["id"] != null) { if (payRelativeToNode.Attributes["id"] != null) { payRelativeToIDRef_ = payRelativeToNode.Attributes["id"].Value; CommodityPayRelativeToEnum ob = new CommodityPayRelativeToEnum(payRelativeToNode); IDManager.SetID(payRelativeToIDRef_, ob); } else if (payRelativeToNode.Attributes["href"] != null) { payRelativeToIDRef_ = payRelativeToNode.Attributes["href"].Value; } else { payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode); } } else { payRelativeTo_ = new CommodityPayRelativeToEnum(payRelativeToNode); } } XmlNode payRelativeToEventNode = xmlNode.SelectSingleNode("payRelativeToEvent"); if (payRelativeToEventNode != null) { if (payRelativeToEventNode.Attributes["href"] != null || payRelativeToEventNode.Attributes["id"] != null) { if (payRelativeToEventNode.Attributes["id"] != null) { payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["id"].Value; CommodityPayRelativeToEvent ob = new CommodityPayRelativeToEvent(payRelativeToEventNode); IDManager.SetID(payRelativeToEventIDRef_, ob); } else if (payRelativeToEventNode.Attributes["href"] != null) { payRelativeToEventIDRef_ = payRelativeToEventNode.Attributes["href"].Value; } else { payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode); } } else { payRelativeToEvent_ = new CommodityPayRelativeToEvent(payRelativeToEventNode); } } XmlNode calculationPeriodsReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsReference"); if (calculationPeriodsReferenceNode != null) { if (calculationPeriodsReferenceNode.Attributes["href"] != null || calculationPeriodsReferenceNode.Attributes["id"] != null) { if (calculationPeriodsReferenceNode.Attributes["id"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["id"].Value; CalculationPeriodsReference ob = new CalculationPeriodsReference(calculationPeriodsReferenceNode); IDManager.SetID(calculationPeriodsReferenceIDRef_, ob); } else if (calculationPeriodsReferenceNode.Attributes["href"] != null) { calculationPeriodsReferenceIDRef_ = calculationPeriodsReferenceNode.Attributes["href"].Value; } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } else { calculationPeriodsReference_ = new CalculationPeriodsReference(calculationPeriodsReferenceNode); } } XmlNode calculationPeriodsScheduleReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNode != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null || calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { if (calculationPeriodsScheduleReferenceNode.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["id"].Value; CalculationPeriodsScheduleReference ob = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef_, ob); } else if (calculationPeriodsScheduleReferenceNode.Attributes["href"] != null) { calculationPeriodsScheduleReferenceIDRef_ = calculationPeriodsScheduleReferenceNode.Attributes["href"].Value; } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } else { calculationPeriodsScheduleReference_ = new CalculationPeriodsScheduleReference(calculationPeriodsScheduleReferenceNode); } } XmlNode calculationPeriodsDatesReferenceNode = xmlNode.SelectSingleNode("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNode != null) { if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null || calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { if (calculationPeriodsDatesReferenceNode.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["id"].Value; CalculationPeriodsDatesReference ob = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); IDManager.SetID(calculationPeriodsDatesReferenceIDRef_, ob); } else if (calculationPeriodsDatesReferenceNode.Attributes["href"] != null) { calculationPeriodsDatesReferenceIDRef_ = calculationPeriodsDatesReferenceNode.Attributes["href"].Value; } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } else { calculationPeriodsDatesReference_ = new CalculationPeriodsDatesReference(calculationPeriodsDatesReferenceNode); } } XmlNode paymentDaysOffsetNode = xmlNode.SelectSingleNode("paymentDaysOffset"); if (paymentDaysOffsetNode != null) { if (paymentDaysOffsetNode.Attributes["href"] != null || paymentDaysOffsetNode.Attributes["id"] != null) { if (paymentDaysOffsetNode.Attributes["id"] != null) { paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["id"].Value; DateOffset ob = new DateOffset(paymentDaysOffsetNode); IDManager.SetID(paymentDaysOffsetIDRef_, ob); } else if (paymentDaysOffsetNode.Attributes["href"] != null) { paymentDaysOffsetIDRef_ = paymentDaysOffsetNode.Attributes["href"].Value; } else { paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode); } } else { paymentDaysOffset_ = new DateOffset(paymentDaysOffsetNode); } } XmlNode businessCentersReferenceNode = xmlNode.SelectSingleNode("businessCentersReference"); if (businessCentersReferenceNode != null) { if (businessCentersReferenceNode.Attributes["href"] != null || businessCentersReferenceNode.Attributes["id"] != null) { if (businessCentersReferenceNode.Attributes["id"] != null) { businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["id"].Value; BusinessCentersReference ob = new BusinessCentersReference(businessCentersReferenceNode); IDManager.SetID(businessCentersReferenceIDRef_, ob); } else if (businessCentersReferenceNode.Attributes["href"] != null) { businessCentersReferenceIDRef_ = businessCentersReferenceNode.Attributes["href"].Value; } else { businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode); } } else { businessCentersReference_ = new BusinessCentersReference(businessCentersReferenceNode); } } XmlNode businessCentersNode = xmlNode.SelectSingleNode("businessCenters"); if (businessCentersNode != null) { if (businessCentersNode.Attributes["href"] != null || businessCentersNode.Attributes["id"] != null) { if (businessCentersNode.Attributes["id"] != null) { businessCentersIDRef_ = businessCentersNode.Attributes["id"].Value; BusinessCenters ob = new BusinessCenters(businessCentersNode); IDManager.SetID(businessCentersIDRef_, ob); } else if (businessCentersNode.Attributes["href"] != null) { businessCentersIDRef_ = businessCentersNode.Attributes["href"].Value; } else { businessCenters_ = new BusinessCenters(businessCentersNode); } } else { businessCenters_ = new BusinessCenters(businessCentersNode); } } }
public CommodityRelativePaymentDates(XmlNode xmlNode) { XmlNodeList payRelativeToNodeList = xmlNode.SelectNodes("payRelativeTo"); if (payRelativeToNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in payRelativeToNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payRelativeToIDRef = item.Attributes["id"].Name; CommodityPayRelativeToEnum ob = CommodityPayRelativeToEnum(); IDManager.SetID(payRelativeToIDRef, ob); } else if (item.Attributes.ToString() == "href") { payRelativeToIDRef = item.Attributes["href"].Name; } else { payRelativeTo = new CommodityPayRelativeToEnum(item); } } } XmlNodeList payRelativeToEventNodeList = xmlNode.SelectNodes("payRelativeToEvent"); if (payRelativeToEventNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in payRelativeToEventNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { payRelativeToEventIDRef = item.Attributes["id"].Name; CommodityPayRelativeToEvent ob = CommodityPayRelativeToEvent(); IDManager.SetID(payRelativeToEventIDRef, ob); } else if (item.Attributes.ToString() == "href") { payRelativeToEventIDRef = item.Attributes["href"].Name; } else { payRelativeToEvent = new CommodityPayRelativeToEvent(item); } } } XmlNodeList calculationPeriodsReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsReference"); if (calculationPeriodsReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsReference ob = CalculationPeriodsReference(); IDManager.SetID(calculationPeriodsReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsReference = new CalculationPeriodsReference(item); } } } XmlNodeList calculationPeriodsScheduleReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsScheduleReference"); if (calculationPeriodsScheduleReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsScheduleReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsScheduleReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsScheduleReference ob = CalculationPeriodsScheduleReference(); IDManager.SetID(calculationPeriodsScheduleReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsScheduleReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsScheduleReference = new CalculationPeriodsScheduleReference(item); } } } XmlNodeList calculationPeriodsDatesReferenceNodeList = xmlNode.SelectNodes("calculationPeriodsDatesReference"); if (calculationPeriodsDatesReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationPeriodsDatesReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationPeriodsDatesReferenceIDRef = item.Attributes["id"].Name; CalculationPeriodsDatesReference ob = CalculationPeriodsDatesReference(); IDManager.SetID(calculationPeriodsDatesReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationPeriodsDatesReferenceIDRef = item.Attributes["href"].Name; } else { calculationPeriodsDatesReference = new CalculationPeriodsDatesReference(item); } } } XmlNodeList paymentDaysOffsetNodeList = xmlNode.SelectNodes("paymentDaysOffset"); if (paymentDaysOffsetNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in paymentDaysOffsetNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { paymentDaysOffsetIDRef = item.Attributes["id"].Name; DateOffset ob = DateOffset(); IDManager.SetID(paymentDaysOffsetIDRef, ob); } else if (item.Attributes.ToString() == "href") { paymentDaysOffsetIDRef = item.Attributes["href"].Name; } else { paymentDaysOffset = new DateOffset(item); } } } XmlNodeList businessCentersReferenceNodeList = xmlNode.SelectNodes("businessCentersReference"); if (businessCentersReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in businessCentersReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { businessCentersReferenceIDRef = item.Attributes["id"].Name; BusinessCentersReference ob = BusinessCentersReference(); IDManager.SetID(businessCentersReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { businessCentersReferenceIDRef = item.Attributes["href"].Name; } else { businessCentersReference = new BusinessCentersReference(item); } } } XmlNodeList businessCentersNodeList = xmlNode.SelectNodes("businessCenters"); if (businessCentersNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in businessCentersNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { businessCentersIDRef = item.Attributes["id"].Name; BusinessCenters ob = BusinessCenters(); IDManager.SetID(businessCentersIDRef, ob); } else if (item.Attributes.ToString() == "href") { businessCentersIDRef = item.Attributes["href"].Name; } else { businessCenters = new BusinessCenters(item); } } } }