public OilPipelineDelivery(XmlNode xmlNode) { XmlNode pipelineNameNode = xmlNode.SelectSingleNode("pipelineName"); if (pipelineNameNode != null) { if (pipelineNameNode.Attributes["href"] != null || pipelineNameNode.Attributes["id"] != null) { if (pipelineNameNode.Attributes["id"] != null) { pipelineNameIDRef_ = pipelineNameNode.Attributes["id"].Value; CommodityPipeline ob = new CommodityPipeline(pipelineNameNode); IDManager.SetID(pipelineNameIDRef_, ob); } else if (pipelineNameNode.Attributes["href"] != null) { pipelineNameIDRef_ = pipelineNameNode.Attributes["href"].Value; } else { pipelineName_ = new CommodityPipeline(pipelineNameNode); } } else { pipelineName_ = new CommodityPipeline(pipelineNameNode); } } XmlNode withdrawalPointNode = xmlNode.SelectSingleNode("withdrawalPoint"); if (withdrawalPointNode != null) { if (withdrawalPointNode.Attributes["href"] != null || withdrawalPointNode.Attributes["id"] != null) { if (withdrawalPointNode.Attributes["id"] != null) { withdrawalPointIDRef_ = withdrawalPointNode.Attributes["id"].Value; CommodityDeliveryPoint ob = new CommodityDeliveryPoint(withdrawalPointNode); IDManager.SetID(withdrawalPointIDRef_, ob); } else if (withdrawalPointNode.Attributes["href"] != null) { withdrawalPointIDRef_ = withdrawalPointNode.Attributes["href"].Value; } else { withdrawalPoint_ = new CommodityDeliveryPoint(withdrawalPointNode); } } else { withdrawalPoint_ = new CommodityDeliveryPoint(withdrawalPointNode); } } XmlNode entryPointNode = xmlNode.SelectSingleNode("entryPoint"); if (entryPointNode != null) { if (entryPointNode.Attributes["href"] != null || entryPointNode.Attributes["id"] != null) { if (entryPointNode.Attributes["id"] != null) { entryPointIDRef_ = entryPointNode.Attributes["id"].Value; CommodityDeliveryPoint ob = new CommodityDeliveryPoint(entryPointNode); IDManager.SetID(entryPointIDRef_, ob); } else if (entryPointNode.Attributes["href"] != null) { entryPointIDRef_ = entryPointNode.Attributes["href"].Value; } else { entryPoint_ = new CommodityDeliveryPoint(entryPointNode); } } else { entryPoint_ = new CommodityDeliveryPoint(entryPointNode); } } XmlNode deliverableByBargeNode = xmlNode.SelectSingleNode("deliverableByBarge"); if (deliverableByBargeNode != null) { if (deliverableByBargeNode.Attributes["href"] != null || deliverableByBargeNode.Attributes["id"] != null) { if (deliverableByBargeNode.Attributes["id"] != null) { deliverableByBargeIDRef_ = deliverableByBargeNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(deliverableByBargeNode); IDManager.SetID(deliverableByBargeIDRef_, ob); } else if (deliverableByBargeNode.Attributes["href"] != null) { deliverableByBargeIDRef_ = deliverableByBargeNode.Attributes["href"].Value; } else { deliverableByBarge_ = new XsdTypeBoolean(deliverableByBargeNode); } } else { deliverableByBarge_ = new XsdTypeBoolean(deliverableByBargeNode); } } XmlNode riskNode = xmlNode.SelectSingleNode("risk"); if (riskNode != null) { if (riskNode.Attributes["href"] != null || riskNode.Attributes["id"] != null) { if (riskNode.Attributes["id"] != null) { riskIDRef_ = riskNode.Attributes["id"].Value; CommodityDeliveryRisk ob = new CommodityDeliveryRisk(riskNode); IDManager.SetID(riskIDRef_, ob); } else if (riskNode.Attributes["href"] != null) { riskIDRef_ = riskNode.Attributes["href"].Value; } else { risk_ = new CommodityDeliveryRisk(riskNode); } } else { risk_ = new CommodityDeliveryRisk(riskNode); } } XmlNodeList cycleNodeList = xmlNode.SelectNodes("cycle"); if (cycleNodeList != null) { this.cycle_ = new List <CommodityPipelineCycle>(); foreach (XmlNode item in cycleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { cycleIDRef_ = item.Attributes["id"].Value; cycle_.Add(new CommodityPipelineCycle(item)); IDManager.SetID(cycleIDRef_, cycle_[cycle_.Count - 1]); } else if (item.Attributes["href"] != null) { cycleIDRef_ = item.Attributes["href"].Value; } else { cycle_.Add(new CommodityPipelineCycle(item)); } } else { cycle_.Add(new CommodityPipelineCycle(item)); } } } }
public OilPipelineDelivery(XmlNode xmlNode) { XmlNodeList pipelineNameNodeList = xmlNode.SelectNodes("pipelineName"); if (pipelineNameNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in pipelineNameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pipelineNameIDRef = item.Attributes["id"].Name; CommodityPipeline ob = CommodityPipeline(); IDManager.SetID(pipelineNameIDRef, ob); } else if (item.Attributes.ToString() == "href") { pipelineNameIDRef = item.Attributes["href"].Name; } else { pipelineName = new CommodityPipeline(item); } } } XmlNodeList withdrawalPointNodeList = xmlNode.SelectNodes("withdrawalPoint"); if (withdrawalPointNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in withdrawalPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { withdrawalPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(withdrawalPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { withdrawalPointIDRef = item.Attributes["href"].Name; } else { withdrawalPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList entryPointNodeList = xmlNode.SelectNodes("entryPoint"); if (entryPointNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in entryPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { entryPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(entryPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { entryPointIDRef = item.Attributes["href"].Name; } else { entryPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList deliverableByBargeNodeList = xmlNode.SelectNodes("deliverableByBarge"); if (deliverableByBargeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in deliverableByBargeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliverableByBargeIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(deliverableByBargeIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliverableByBargeIDRef = item.Attributes["href"].Name; } else { deliverableByBarge = new XsdTypeBoolean(item); } } } XmlNodeList riskNodeList = xmlNode.SelectNodes("risk"); if (riskNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in riskNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { riskIDRef = item.Attributes["id"].Name; CommodityDeliveryRisk ob = CommodityDeliveryRisk(); IDManager.SetID(riskIDRef, ob); } else if (item.Attributes.ToString() == "href") { riskIDRef = item.Attributes["href"].Name; } else { risk = new CommodityDeliveryRisk(item); } } } XmlNodeList cycleNodeList = xmlNode.SelectNodes("cycle"); foreach (XmlNode item in cycleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cycleIDRef = item.Attributes["id"].Name; List <CommodityPipelineCycle> ob = new List <CommodityPipelineCycle>(); ob.Add(new CommodityPipelineCycle(item)); IDManager.SetID(cycleIDRef, ob); } else if (item.Attributes.ToString() == "href") { cycleIDRef = item.Attributes["href"].Name; } else { cycle.Add(new CommodityPipelineCycle(item)); } } } }
public OilPipelineDelivery(XmlNode xmlNode) { XmlNode pipelineNameNode = xmlNode.SelectSingleNode("pipelineName"); if (pipelineNameNode != null) { if (pipelineNameNode.Attributes["href"] != null || pipelineNameNode.Attributes["id"] != null) { if (pipelineNameNode.Attributes["id"] != null) { pipelineNameIDRef_ = pipelineNameNode.Attributes["id"].Value; CommodityPipeline ob = new CommodityPipeline(pipelineNameNode); IDManager.SetID(pipelineNameIDRef_, ob); } else if (pipelineNameNode.Attributes["href"] != null) { pipelineNameIDRef_ = pipelineNameNode.Attributes["href"].Value; } else { pipelineName_ = new CommodityPipeline(pipelineNameNode); } } else { pipelineName_ = new CommodityPipeline(pipelineNameNode); } } XmlNode withdrawalPointNode = xmlNode.SelectSingleNode("withdrawalPoint"); if (withdrawalPointNode != null) { if (withdrawalPointNode.Attributes["href"] != null || withdrawalPointNode.Attributes["id"] != null) { if (withdrawalPointNode.Attributes["id"] != null) { withdrawalPointIDRef_ = withdrawalPointNode.Attributes["id"].Value; CommodityDeliveryPoint ob = new CommodityDeliveryPoint(withdrawalPointNode); IDManager.SetID(withdrawalPointIDRef_, ob); } else if (withdrawalPointNode.Attributes["href"] != null) { withdrawalPointIDRef_ = withdrawalPointNode.Attributes["href"].Value; } else { withdrawalPoint_ = new CommodityDeliveryPoint(withdrawalPointNode); } } else { withdrawalPoint_ = new CommodityDeliveryPoint(withdrawalPointNode); } } XmlNode entryPointNode = xmlNode.SelectSingleNode("entryPoint"); if (entryPointNode != null) { if (entryPointNode.Attributes["href"] != null || entryPointNode.Attributes["id"] != null) { if (entryPointNode.Attributes["id"] != null) { entryPointIDRef_ = entryPointNode.Attributes["id"].Value; CommodityDeliveryPoint ob = new CommodityDeliveryPoint(entryPointNode); IDManager.SetID(entryPointIDRef_, ob); } else if (entryPointNode.Attributes["href"] != null) { entryPointIDRef_ = entryPointNode.Attributes["href"].Value; } else { entryPoint_ = new CommodityDeliveryPoint(entryPointNode); } } else { entryPoint_ = new CommodityDeliveryPoint(entryPointNode); } } XmlNode deliverableByBargeNode = xmlNode.SelectSingleNode("deliverableByBarge"); if (deliverableByBargeNode != null) { if (deliverableByBargeNode.Attributes["href"] != null || deliverableByBargeNode.Attributes["id"] != null) { if (deliverableByBargeNode.Attributes["id"] != null) { deliverableByBargeIDRef_ = deliverableByBargeNode.Attributes["id"].Value; XsdTypeBoolean ob = new XsdTypeBoolean(deliverableByBargeNode); IDManager.SetID(deliverableByBargeIDRef_, ob); } else if (deliverableByBargeNode.Attributes["href"] != null) { deliverableByBargeIDRef_ = deliverableByBargeNode.Attributes["href"].Value; } else { deliverableByBarge_ = new XsdTypeBoolean(deliverableByBargeNode); } } else { deliverableByBarge_ = new XsdTypeBoolean(deliverableByBargeNode); } } XmlNode riskNode = xmlNode.SelectSingleNode("risk"); if (riskNode != null) { if (riskNode.Attributes["href"] != null || riskNode.Attributes["id"] != null) { if (riskNode.Attributes["id"] != null) { riskIDRef_ = riskNode.Attributes["id"].Value; CommodityDeliveryRisk ob = new CommodityDeliveryRisk(riskNode); IDManager.SetID(riskIDRef_, ob); } else if (riskNode.Attributes["href"] != null) { riskIDRef_ = riskNode.Attributes["href"].Value; } else { risk_ = new CommodityDeliveryRisk(riskNode); } } else { risk_ = new CommodityDeliveryRisk(riskNode); } } XmlNodeList cycleNodeList = xmlNode.SelectNodes("cycle"); if (cycleNodeList != null) { this.cycle_ = new List<CommodityPipelineCycle>(); foreach (XmlNode item in cycleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { cycleIDRef_ = item.Attributes["id"].Value; cycle_.Add(new CommodityPipelineCycle(item)); IDManager.SetID(cycleIDRef_, cycle_[cycle_.Count - 1 ]); } else if (item.Attributes["href"] != null) { cycleIDRef_ = item.Attributes["href"].Value; } else { cycle_.Add(new CommodityPipelineCycle(item)); } } else { cycle_.Add(new CommodityPipelineCycle(item)); } } } }
public OilPipelineDelivery(XmlNode xmlNode) { XmlNodeList pipelineNameNodeList = xmlNode.SelectNodes("pipelineName"); if (pipelineNameNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pipelineNameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pipelineNameIDRef = item.Attributes["id"].Name; CommodityPipeline ob = CommodityPipeline(); IDManager.SetID(pipelineNameIDRef, ob); } else if (item.Attributes.ToString() == "href") { pipelineNameIDRef = item.Attributes["href"].Name; } else { pipelineName = new CommodityPipeline(item); } } } XmlNodeList withdrawalPointNodeList = xmlNode.SelectNodes("withdrawalPoint"); if (withdrawalPointNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in withdrawalPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { withdrawalPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(withdrawalPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { withdrawalPointIDRef = item.Attributes["href"].Name; } else { withdrawalPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList entryPointNodeList = xmlNode.SelectNodes("entryPoint"); if (entryPointNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in entryPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { entryPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(entryPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { entryPointIDRef = item.Attributes["href"].Name; } else { entryPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList deliverableByBargeNodeList = xmlNode.SelectNodes("deliverableByBarge"); if (deliverableByBargeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliverableByBargeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliverableByBargeIDRef = item.Attributes["id"].Name; XsdTypeBoolean ob = XsdTypeBoolean(); IDManager.SetID(deliverableByBargeIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliverableByBargeIDRef = item.Attributes["href"].Name; } else { deliverableByBarge = new XsdTypeBoolean(item); } } } XmlNodeList riskNodeList = xmlNode.SelectNodes("risk"); if (riskNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in riskNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { riskIDRef = item.Attributes["id"].Name; CommodityDeliveryRisk ob = CommodityDeliveryRisk(); IDManager.SetID(riskIDRef, ob); } else if (item.Attributes.ToString() == "href") { riskIDRef = item.Attributes["href"].Name; } else { risk = new CommodityDeliveryRisk(item); } } } XmlNodeList cycleNodeList = xmlNode.SelectNodes("cycle"); foreach (XmlNode item in cycleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { cycleIDRef = item.Attributes["id"].Name; List<CommodityPipelineCycle> ob = new List<CommodityPipelineCycle>(); ob.Add(new CommodityPipelineCycle(item)); IDManager.SetID(cycleIDRef, ob); } else if (item.Attributes.ToString() == "href") { cycleIDRef = item.Attributes["href"].Name; } else { cycle.Add(new CommodityPipelineCycle(item)); } } } }