public CoalPhysicalLeg(XmlNode xmlNode) : base(xmlNode) { XmlNode deliveryPeriodsNode = xmlNode.SelectSingleNode("deliveryPeriods"); if (deliveryPeriodsNode != null) { if (deliveryPeriodsNode.Attributes["href"] != null || deliveryPeriodsNode.Attributes["id"] != null) { if (deliveryPeriodsNode.Attributes["id"] != null) { deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["id"].Value; CommodityDeliveryPeriods ob = new CommodityDeliveryPeriods(deliveryPeriodsNode); IDManager.SetID(deliveryPeriodsIDRef_, ob); } else if (deliveryPeriodsNode.Attributes["href"] != null) { deliveryPeriodsIDRef_ = deliveryPeriodsNode.Attributes["href"].Value; } else { deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode); } } else { deliveryPeriods_ = new CommodityDeliveryPeriods(deliveryPeriodsNode); } } XmlNode coalNode = xmlNode.SelectSingleNode("coal"); if (coalNode != null) { if (coalNode.Attributes["href"] != null || coalNode.Attributes["id"] != null) { if (coalNode.Attributes["id"] != null) { coalIDRef_ = coalNode.Attributes["id"].Value; CoalProduct ob = new CoalProduct(coalNode); IDManager.SetID(coalIDRef_, ob); } else if (coalNode.Attributes["href"] != null) { coalIDRef_ = coalNode.Attributes["href"].Value; } else { coal_ = new CoalProduct(coalNode); } } else { coal_ = new CoalProduct(coalNode); } } XmlNode deliveryConditionsNode = xmlNode.SelectSingleNode("deliveryConditions"); if (deliveryConditionsNode != null) { if (deliveryConditionsNode.Attributes["href"] != null || deliveryConditionsNode.Attributes["id"] != null) { if (deliveryConditionsNode.Attributes["id"] != null) { deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["id"].Value; CoalDelivery ob = new CoalDelivery(deliveryConditionsNode); IDManager.SetID(deliveryConditionsIDRef_, ob); } else if (deliveryConditionsNode.Attributes["href"] != null) { deliveryConditionsIDRef_ = deliveryConditionsNode.Attributes["href"].Value; } else { deliveryConditions_ = new CoalDelivery(deliveryConditionsNode); } } else { deliveryConditions_ = new CoalDelivery(deliveryConditionsNode); } } XmlNode deliveryQuantityNode = xmlNode.SelectSingleNode("deliveryQuantity"); if (deliveryQuantityNode != null) { if (deliveryQuantityNode.Attributes["href"] != null || deliveryQuantityNode.Attributes["id"] != null) { if (deliveryQuantityNode.Attributes["id"] != null) { deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["id"].Value; CommodityPhysicalQuantity ob = new CommodityPhysicalQuantity(deliveryQuantityNode); IDManager.SetID(deliveryQuantityIDRef_, ob); } else if (deliveryQuantityNode.Attributes["href"] != null) { deliveryQuantityIDRef_ = deliveryQuantityNode.Attributes["href"].Value; } else { deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode); } } else { deliveryQuantity_ = new CommodityPhysicalQuantity(deliveryQuantityNode); } } }
public CoalPhysicalLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods"); if (deliveryPeriodsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliveryPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryPeriodsIDRef = item.Attributes["id"].Name; CommodityDeliveryPeriods ob = CommodityDeliveryPeriods(); IDManager.SetID(deliveryPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryPeriodsIDRef = item.Attributes["href"].Name; } else { deliveryPeriods = new CommodityDeliveryPeriods(item); } } } XmlNodeList coalNodeList = xmlNode.SelectNodes("coal"); if (coalNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in coalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coalIDRef = item.Attributes["id"].Name; CoalProduct ob = CoalProduct(); IDManager.SetID(coalIDRef, ob); } else if (item.Attributes.ToString() == "href") { coalIDRef = item.Attributes["href"].Name; } else { coal = new CoalProduct(item); } } } XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions"); if (deliveryConditionsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliveryConditionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryConditionsIDRef = item.Attributes["id"].Name; CoalDelivery ob = CoalDelivery(); IDManager.SetID(deliveryConditionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryConditionsIDRef = item.Attributes["href"].Name; } else { deliveryConditions = new CoalDelivery(item); } } } XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity"); if (deliveryQuantityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliveryQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryQuantityIDRef = item.Attributes["id"].Name; CommodityPhysicalQuantity ob = CommodityPhysicalQuantity(); IDManager.SetID(deliveryQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryQuantityIDRef = item.Attributes["href"].Name; } else { deliveryQuantity = new CommodityPhysicalQuantity(item); } } } }
public CoalPhysicalLeg(XmlNode xmlNode) : base(xmlNode) { XmlNodeList deliveryPeriodsNodeList = xmlNode.SelectNodes("deliveryPeriods"); if (deliveryPeriodsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in deliveryPeriodsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryPeriodsIDRef = item.Attributes["id"].Name; CommodityDeliveryPeriods ob = CommodityDeliveryPeriods(); IDManager.SetID(deliveryPeriodsIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryPeriodsIDRef = item.Attributes["href"].Name; } else { deliveryPeriods = new CommodityDeliveryPeriods(item); } } } XmlNodeList coalNodeList = xmlNode.SelectNodes("coal"); if (coalNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in coalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coalIDRef = item.Attributes["id"].Name; CoalProduct ob = CoalProduct(); IDManager.SetID(coalIDRef, ob); } else if (item.Attributes.ToString() == "href") { coalIDRef = item.Attributes["href"].Name; } else { coal = new CoalProduct(item); } } } XmlNodeList deliveryConditionsNodeList = xmlNode.SelectNodes("deliveryConditions"); if (deliveryConditionsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in deliveryConditionsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryConditionsIDRef = item.Attributes["id"].Name; CoalDelivery ob = CoalDelivery(); IDManager.SetID(deliveryConditionsIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryConditionsIDRef = item.Attributes["href"].Name; } else { deliveryConditions = new CoalDelivery(item); } } } XmlNodeList deliveryQuantityNodeList = xmlNode.SelectNodes("deliveryQuantity"); if (deliveryQuantityNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in deliveryQuantityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryQuantityIDRef = item.Attributes["id"].Name; CommodityPhysicalQuantity ob = CommodityPhysicalQuantity(); IDManager.SetID(deliveryQuantityIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryQuantityIDRef = item.Attributes["href"].Name; } else { deliveryQuantity = new CommodityPhysicalQuantity(item); } } } }