public MetalDelivery(XmlNode xmlNode) { XmlNodeList deliveryLocationNodeList = xmlNode.SelectNodes("deliveryLocation"); if (deliveryLocationNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in deliveryLocationNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryLocationIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(deliveryLocationIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryLocationIDRef = item.Attributes["href"].Name; } else { deliveryLocation = new CommodityDeliveryPoint(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 totalQuantityToleranceNodeList = xmlNode.SelectNodes("totalQuantityTolerance"); if (totalQuantityToleranceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in totalQuantityToleranceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { totalQuantityToleranceIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(totalQuantityToleranceIDRef, ob); } else if (item.Attributes.ToString() == "href") { totalQuantityToleranceIDRef = item.Attributes["href"].Name; } else { totalQuantityTolerance = new XsdTypeDecimal(item); } } } XmlNodeList periodQuantityToleranceNodeList = xmlNode.SelectNodes("periodQuantityTolerance"); if (periodQuantityToleranceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in periodQuantityToleranceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { periodQuantityToleranceIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(periodQuantityToleranceIDRef, ob); } else if (item.Attributes.ToString() == "href") { periodQuantityToleranceIDRef = item.Attributes["href"].Name; } else { periodQuantityTolerance = new XsdTypeDecimal(item); } } } XmlNodeList titleNodeList = xmlNode.SelectNodes("title"); if (titleNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in titleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { titleIDRef = item.Attributes["id"].Name; MetalTitleEnum ob = MetalTitleEnum(); IDManager.SetID(titleIDRef, ob); } else if (item.Attributes.ToString() == "href") { titleIDRef = item.Attributes["href"].Name; } else { title = new MetalTitleEnum(item); } } } }
public MetalDelivery(XmlNode xmlNode) { XmlNode deliveryLocationNode = xmlNode.SelectSingleNode("deliveryLocation"); if (deliveryLocationNode != null) { if (deliveryLocationNode.Attributes["href"] != null || deliveryLocationNode.Attributes["id"] != null) { if (deliveryLocationNode.Attributes["id"] != null) { deliveryLocationIDRef_ = deliveryLocationNode.Attributes["id"].Value; CommodityDeliveryPoint ob = new CommodityDeliveryPoint(deliveryLocationNode); IDManager.SetID(deliveryLocationIDRef_, ob); } else if (deliveryLocationNode.Attributes["href"] != null) { deliveryLocationIDRef_ = deliveryLocationNode.Attributes["href"].Value; } else { deliveryLocation_ = new CommodityDeliveryPoint(deliveryLocationNode); } } else { deliveryLocation_ = new CommodityDeliveryPoint(deliveryLocationNode); } } 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); } } XmlNode totalQuantityToleranceNode = xmlNode.SelectSingleNode("totalQuantityTolerance"); if (totalQuantityToleranceNode != null) { if (totalQuantityToleranceNode.Attributes["href"] != null || totalQuantityToleranceNode.Attributes["id"] != null) { if (totalQuantityToleranceNode.Attributes["id"] != null) { totalQuantityToleranceIDRef_ = totalQuantityToleranceNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(totalQuantityToleranceNode); IDManager.SetID(totalQuantityToleranceIDRef_, ob); } else if (totalQuantityToleranceNode.Attributes["href"] != null) { totalQuantityToleranceIDRef_ = totalQuantityToleranceNode.Attributes["href"].Value; } else { totalQuantityTolerance_ = new XsdTypeDecimal(totalQuantityToleranceNode); } } else { totalQuantityTolerance_ = new XsdTypeDecimal(totalQuantityToleranceNode); } } XmlNode periodQuantityToleranceNode = xmlNode.SelectSingleNode("periodQuantityTolerance"); if (periodQuantityToleranceNode != null) { if (periodQuantityToleranceNode.Attributes["href"] != null || periodQuantityToleranceNode.Attributes["id"] != null) { if (periodQuantityToleranceNode.Attributes["id"] != null) { periodQuantityToleranceIDRef_ = periodQuantityToleranceNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(periodQuantityToleranceNode); IDManager.SetID(periodQuantityToleranceIDRef_, ob); } else if (periodQuantityToleranceNode.Attributes["href"] != null) { periodQuantityToleranceIDRef_ = periodQuantityToleranceNode.Attributes["href"].Value; } else { periodQuantityTolerance_ = new XsdTypeDecimal(periodQuantityToleranceNode); } } else { periodQuantityTolerance_ = new XsdTypeDecimal(periodQuantityToleranceNode); } } XmlNode titleNode = xmlNode.SelectSingleNode("title"); if (titleNode != null) { if (titleNode.Attributes["href"] != null || titleNode.Attributes["id"] != null) { if (titleNode.Attributes["id"] != null) { titleIDRef_ = titleNode.Attributes["id"].Value; MetalTitleEnum ob = new MetalTitleEnum(titleNode); IDManager.SetID(titleIDRef_, ob); } else if (titleNode.Attributes["href"] != null) { titleIDRef_ = titleNode.Attributes["href"].Value; } else { title_ = new MetalTitleEnum(titleNode); } } else { title_ = new MetalTitleEnum(titleNode); } } }