public Allocation(XmlNode xmlNode) { XmlNodeList allocationTradeIdNodeList = xmlNode.SelectNodes("allocationTradeId"); if (allocationTradeIdNodeList != null) { this.allocationTradeId_ = new List<TradeIdentifier>(); foreach (XmlNode item in allocationTradeIdNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { allocationTradeIdIDRef_ = item.Attributes["id"].Value; allocationTradeId_.Add(new TradeIdentifier(item)); IDManager.SetID(allocationTradeIdIDRef_, allocationTradeId_[allocationTradeId_.Count - 1 ]); } else if (item.Attributes["href"] != null) { allocationTradeIdIDRef_ = item.Attributes["href"].Value; } else { allocationTradeId_.Add(new TradeIdentifier(item)); } } else { allocationTradeId_.Add(new TradeIdentifier(item)); } } } XmlNode partyReferenceNode = xmlNode.SelectSingleNode("partyReference"); if (partyReferenceNode != null) { if (partyReferenceNode.Attributes["href"] != null || partyReferenceNode.Attributes["id"] != null) { if (partyReferenceNode.Attributes["id"] != null) { partyReferenceIDRef_ = partyReferenceNode.Attributes["id"].Value; PartyReference ob = new PartyReference(partyReferenceNode); IDManager.SetID(partyReferenceIDRef_, ob); } else if (partyReferenceNode.Attributes["href"] != null) { partyReferenceIDRef_ = partyReferenceNode.Attributes["href"].Value; } else { partyReference_ = new PartyReference(partyReferenceNode); } } else { partyReference_ = new PartyReference(partyReferenceNode); } } XmlNode accountReferenceNode = xmlNode.SelectSingleNode("accountReference"); if (accountReferenceNode != null) { if (accountReferenceNode.Attributes["href"] != null || accountReferenceNode.Attributes["id"] != null) { if (accountReferenceNode.Attributes["id"] != null) { accountReferenceIDRef_ = accountReferenceNode.Attributes["id"].Value; AccountReference ob = new AccountReference(accountReferenceNode); IDManager.SetID(accountReferenceIDRef_, ob); } else if (accountReferenceNode.Attributes["href"] != null) { accountReferenceIDRef_ = accountReferenceNode.Attributes["href"].Value; } else { accountReference_ = new AccountReference(accountReferenceNode); } } else { accountReference_ = new AccountReference(accountReferenceNode); } } XmlNode allocatedFractionNode = xmlNode.SelectSingleNode("allocatedFraction"); if (allocatedFractionNode != null) { if (allocatedFractionNode.Attributes["href"] != null || allocatedFractionNode.Attributes["id"] != null) { if (allocatedFractionNode.Attributes["id"] != null) { allocatedFractionIDRef_ = allocatedFractionNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(allocatedFractionNode); IDManager.SetID(allocatedFractionIDRef_, ob); } else if (allocatedFractionNode.Attributes["href"] != null) { allocatedFractionIDRef_ = allocatedFractionNode.Attributes["href"].Value; } else { allocatedFraction_ = new XsdTypeDecimal(allocatedFractionNode); } } else { allocatedFraction_ = new XsdTypeDecimal(allocatedFractionNode); } } XmlNodeList allocatedNotionalNodeList = xmlNode.SelectNodes("allocatedNotional"); if (allocatedNotionalNodeList != null) { this.allocatedNotional_ = new List<Money>(); foreach (XmlNode item in allocatedNotionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { allocatedNotionalIDRef_ = item.Attributes["id"].Value; allocatedNotional_.Add(new Money(item)); IDManager.SetID(allocatedNotionalIDRef_, allocatedNotional_[allocatedNotional_.Count - 1 ]); } else if (item.Attributes["href"] != null) { allocatedNotionalIDRef_ = item.Attributes["href"].Value; } else { allocatedNotional_.Add(new Money(item)); } } else { allocatedNotional_.Add(new Money(item)); } } } XmlNode collateralNode = xmlNode.SelectSingleNode("collateral"); if (collateralNode != null) { if (collateralNode.Attributes["href"] != null || collateralNode.Attributes["id"] != null) { if (collateralNode.Attributes["id"] != null) { collateralIDRef_ = collateralNode.Attributes["id"].Value; Collateral ob = new Collateral(collateralNode); IDManager.SetID(collateralIDRef_, ob); } else if (collateralNode.Attributes["href"] != null) { collateralIDRef_ = collateralNode.Attributes["href"].Value; } else { collateral_ = new Collateral(collateralNode); } } else { collateral_ = new Collateral(collateralNode); } } XmlNode creditChargeAmountNode = xmlNode.SelectSingleNode("creditChargeAmount"); if (creditChargeAmountNode != null) { if (creditChargeAmountNode.Attributes["href"] != null || creditChargeAmountNode.Attributes["id"] != null) { if (creditChargeAmountNode.Attributes["id"] != null) { creditChargeAmountIDRef_ = creditChargeAmountNode.Attributes["id"].Value; Money ob = new Money(creditChargeAmountNode); IDManager.SetID(creditChargeAmountIDRef_, ob); } else if (creditChargeAmountNode.Attributes["href"] != null) { creditChargeAmountIDRef_ = creditChargeAmountNode.Attributes["href"].Value; } else { creditChargeAmount_ = new Money(creditChargeAmountNode); } } else { creditChargeAmount_ = new Money(creditChargeAmountNode); } } XmlNode approvalsNode = xmlNode.SelectSingleNode("approvals"); if (approvalsNode != null) { if (approvalsNode.Attributes["href"] != null || approvalsNode.Attributes["id"] != null) { if (approvalsNode.Attributes["id"] != null) { approvalsIDRef_ = approvalsNode.Attributes["id"].Value; Approvals ob = new Approvals(approvalsNode); IDManager.SetID(approvalsIDRef_, ob); } else if (approvalsNode.Attributes["href"] != null) { approvalsIDRef_ = approvalsNode.Attributes["href"].Value; } else { approvals_ = new Approvals(approvalsNode); } } else { approvals_ = new Approvals(approvalsNode); } } XmlNode masterConfirmationDateNode = xmlNode.SelectSingleNode("masterConfirmationDate"); if (masterConfirmationDateNode != null) { if (masterConfirmationDateNode.Attributes["href"] != null || masterConfirmationDateNode.Attributes["id"] != null) { if (masterConfirmationDateNode.Attributes["id"] != null) { masterConfirmationDateIDRef_ = masterConfirmationDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(masterConfirmationDateNode); IDManager.SetID(masterConfirmationDateIDRef_, ob); } else if (masterConfirmationDateNode.Attributes["href"] != null) { masterConfirmationDateIDRef_ = masterConfirmationDateNode.Attributes["href"].Value; } else { masterConfirmationDate_ = new XsdTypeDate(masterConfirmationDateNode); } } else { masterConfirmationDate_ = new XsdTypeDate(masterConfirmationDateNode); } } XmlNodeList relatedPartyNodeList = xmlNode.SelectNodes("relatedParty"); if (relatedPartyNodeList != null) { this.relatedParty_ = new List<RelatedParty>(); foreach (XmlNode item in relatedPartyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { relatedPartyIDRef_ = item.Attributes["id"].Value; relatedParty_.Add(new RelatedParty(item)); IDManager.SetID(relatedPartyIDRef_, relatedParty_[relatedParty_.Count - 1 ]); } else if (item.Attributes["href"] != null) { relatedPartyIDRef_ = item.Attributes["href"].Value; } else { relatedParty_.Add(new RelatedParty(item)); } } else { relatedParty_.Add(new RelatedParty(item)); } } } }
public Allocation(XmlNode xmlNode) { XmlNodeList allocationTradeIdNodeList = xmlNode.SelectNodes("allocationTradeId"); foreach (XmlNode item in allocationTradeIdNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocationTradeIdIDRef = item.Attributes["id"].Name; List<TradeIdentifier> ob = new List<TradeIdentifier>(); ob.Add(new TradeIdentifier(item)); IDManager.SetID(allocationTradeIdIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocationTradeIdIDRef = item.Attributes["href"].Name; } else { allocationTradeId.Add(new TradeIdentifier(item)); } } } XmlNodeList partyReferenceNodeList = xmlNode.SelectNodes("partyReference"); if (partyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in partyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { partyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(partyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { partyReferenceIDRef = item.Attributes["href"].Name; } else { partyReference = new PartyReference(item); } } } XmlNodeList accountReferenceNodeList = xmlNode.SelectNodes("accountReference"); if (accountReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in accountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { accountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(accountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { accountReferenceIDRef = item.Attributes["href"].Name; } else { accountReference = new AccountReference(item); } } } XmlNodeList allocatedFractionNodeList = xmlNode.SelectNodes("allocatedFraction"); if (allocatedFractionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in allocatedFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocatedFractionIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(allocatedFractionIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocatedFractionIDRef = item.Attributes["href"].Name; } else { allocatedFraction = new XsdTypeDecimal(item); } } } XmlNodeList allocatedNotionalNodeList = xmlNode.SelectNodes("allocatedNotional"); foreach (XmlNode item in allocatedNotionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocatedNotionalIDRef = item.Attributes["id"].Name; List<Money> ob = new List<Money>(); ob.Add(new Money(item)); IDManager.SetID(allocatedNotionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocatedNotionalIDRef = item.Attributes["href"].Name; } else { allocatedNotional.Add(new Money(item)); } } } XmlNodeList collateralNodeList = xmlNode.SelectNodes("collateral"); if (collateralNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in collateralNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { collateralIDRef = item.Attributes["id"].Name; Collateral ob = Collateral(); IDManager.SetID(collateralIDRef, ob); } else if (item.Attributes.ToString() == "href") { collateralIDRef = item.Attributes["href"].Name; } else { collateral = new Collateral(item); } } } XmlNodeList creditChargeAmountNodeList = xmlNode.SelectNodes("creditChargeAmount"); if (creditChargeAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in creditChargeAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { creditChargeAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(creditChargeAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { creditChargeAmountIDRef = item.Attributes["href"].Name; } else { creditChargeAmount = new Money(item); } } } XmlNodeList approvalsNodeList = xmlNode.SelectNodes("approvals"); if (approvalsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in approvalsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { approvalsIDRef = item.Attributes["id"].Name; Approvals ob = Approvals(); IDManager.SetID(approvalsIDRef, ob); } else if (item.Attributes.ToString() == "href") { approvalsIDRef = item.Attributes["href"].Name; } else { approvals = new Approvals(item); } } } XmlNodeList masterConfirmationDateNodeList = xmlNode.SelectNodes("masterConfirmationDate"); if (masterConfirmationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in masterConfirmationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { masterConfirmationDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(masterConfirmationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { masterConfirmationDateIDRef = item.Attributes["href"].Name; } else { masterConfirmationDate = new XsdTypeDate(item); } } } XmlNodeList relatedPartyNodeList = xmlNode.SelectNodes("relatedParty"); foreach (XmlNode item in relatedPartyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { relatedPartyIDRef = item.Attributes["id"].Name; List<RelatedParty> ob = new List<RelatedParty>(); ob.Add(new RelatedParty(item)); IDManager.SetID(relatedPartyIDRef, ob); } else if (item.Attributes.ToString() == "href") { relatedPartyIDRef = item.Attributes["href"].Name; } else { relatedParty.Add(new RelatedParty(item)); } } } }
public Allocation(XmlNode xmlNode) { XmlNodeList allocationTradeIdNodeList = xmlNode.SelectNodes("allocationTradeId"); foreach (XmlNode item in allocationTradeIdNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocationTradeIdIDRef = item.Attributes["id"].Name; List <TradeIdentifier> ob = new List <TradeIdentifier>(); ob.Add(new TradeIdentifier(item)); IDManager.SetID(allocationTradeIdIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocationTradeIdIDRef = item.Attributes["href"].Name; } else { allocationTradeId.Add(new TradeIdentifier(item)); } } } XmlNodeList partyReferenceNodeList = xmlNode.SelectNodes("partyReference"); if (partyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in partyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { partyReferenceIDRef = item.Attributes["id"].Name; PartyReference ob = PartyReference(); IDManager.SetID(partyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { partyReferenceIDRef = item.Attributes["href"].Name; } else { partyReference = new PartyReference(item); } } } XmlNodeList accountReferenceNodeList = xmlNode.SelectNodes("accountReference"); if (accountReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in accountReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { accountReferenceIDRef = item.Attributes["id"].Name; AccountReference ob = AccountReference(); IDManager.SetID(accountReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { accountReferenceIDRef = item.Attributes["href"].Name; } else { accountReference = new AccountReference(item); } } } XmlNodeList allocatedFractionNodeList = xmlNode.SelectNodes("allocatedFraction"); if (allocatedFractionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in allocatedFractionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocatedFractionIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(allocatedFractionIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocatedFractionIDRef = item.Attributes["href"].Name; } else { allocatedFraction = new XsdTypeDecimal(item); } } } XmlNodeList allocatedNotionalNodeList = xmlNode.SelectNodes("allocatedNotional"); foreach (XmlNode item in allocatedNotionalNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { allocatedNotionalIDRef = item.Attributes["id"].Name; List <Money> ob = new List <Money>(); ob.Add(new Money(item)); IDManager.SetID(allocatedNotionalIDRef, ob); } else if (item.Attributes.ToString() == "href") { allocatedNotionalIDRef = item.Attributes["href"].Name; } else { allocatedNotional.Add(new Money(item)); } } } XmlNodeList collateralNodeList = xmlNode.SelectNodes("collateral"); if (collateralNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in collateralNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { collateralIDRef = item.Attributes["id"].Name; Collateral ob = Collateral(); IDManager.SetID(collateralIDRef, ob); } else if (item.Attributes.ToString() == "href") { collateralIDRef = item.Attributes["href"].Name; } else { collateral = new Collateral(item); } } } XmlNodeList creditChargeAmountNodeList = xmlNode.SelectNodes("creditChargeAmount"); if (creditChargeAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in creditChargeAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { creditChargeAmountIDRef = item.Attributes["id"].Name; Money ob = Money(); IDManager.SetID(creditChargeAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { creditChargeAmountIDRef = item.Attributes["href"].Name; } else { creditChargeAmount = new Money(item); } } } XmlNodeList approvalsNodeList = xmlNode.SelectNodes("approvals"); if (approvalsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in approvalsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { approvalsIDRef = item.Attributes["id"].Name; Approvals ob = Approvals(); IDManager.SetID(approvalsIDRef, ob); } else if (item.Attributes.ToString() == "href") { approvalsIDRef = item.Attributes["href"].Name; } else { approvals = new Approvals(item); } } } XmlNodeList masterConfirmationDateNodeList = xmlNode.SelectNodes("masterConfirmationDate"); if (masterConfirmationDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in masterConfirmationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { masterConfirmationDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(masterConfirmationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { masterConfirmationDateIDRef = item.Attributes["href"].Name; } else { masterConfirmationDate = new XsdTypeDate(item); } } } XmlNodeList relatedPartyNodeList = xmlNode.SelectNodes("relatedParty"); foreach (XmlNode item in relatedPartyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { relatedPartyIDRef = item.Attributes["id"].Name; List <RelatedParty> ob = new List <RelatedParty>(); ob.Add(new RelatedParty(item)); IDManager.SetID(relatedPartyIDRef, ob); } else if (item.Attributes.ToString() == "href") { relatedPartyIDRef = item.Attributes["href"].Name; } else { relatedParty.Add(new RelatedParty(item)); } } } }