public Loan(XmlNode xmlNode) : base(xmlNode) { XmlNode borrowerNode = xmlNode.SelectSingleNode("borrower"); if (borrowerNode != null) { if (borrowerNode.Attributes["href"] != null || borrowerNode.Attributes["id"] != null) { if (borrowerNode.Attributes["id"] != null) { borrowerIDRef_ = borrowerNode.Attributes["id"].Value; LegalEntity ob = new LegalEntity(borrowerNode); IDManager.SetID(borrowerIDRef_, ob); } else if (borrowerNode.Attributes["href"] != null) { borrowerIDRef_ = borrowerNode.Attributes["href"].Value; } else { borrower_ = new LegalEntity(borrowerNode); } } else { borrower_ = new LegalEntity(borrowerNode); } } XmlNode borrowerReferenceNode = xmlNode.SelectSingleNode("borrowerReference"); if (borrowerReferenceNode != null) { if (borrowerReferenceNode.Attributes["href"] != null || borrowerReferenceNode.Attributes["id"] != null) { if (borrowerReferenceNode.Attributes["id"] != null) { borrowerReferenceIDRef_ = borrowerReferenceNode.Attributes["id"].Value; LegalEntityReference ob = new LegalEntityReference(borrowerReferenceNode); IDManager.SetID(borrowerReferenceIDRef_, ob); } else if (borrowerReferenceNode.Attributes["href"] != null) { borrowerReferenceIDRef_ = borrowerReferenceNode.Attributes["href"].Value; } else { borrowerReference_ = new LegalEntityReference(borrowerReferenceNode); } } else { borrowerReference_ = new LegalEntityReference(borrowerReferenceNode); } } XmlNode lienNode = xmlNode.SelectSingleNode("lien"); if (lienNode != null) { if (lienNode.Attributes["href"] != null || lienNode.Attributes["id"] != null) { if (lienNode.Attributes["id"] != null) { lienIDRef_ = lienNode.Attributes["id"].Value; Lien ob = new Lien(lienNode); IDManager.SetID(lienIDRef_, ob); } else if (lienNode.Attributes["href"] != null) { lienIDRef_ = lienNode.Attributes["href"].Value; } else { lien_ = new Lien(lienNode); } } else { lien_ = new Lien(lienNode); } } XmlNode facilityTypeNode = xmlNode.SelectSingleNode("facilityType"); if (facilityTypeNode != null) { if (facilityTypeNode.Attributes["href"] != null || facilityTypeNode.Attributes["id"] != null) { if (facilityTypeNode.Attributes["id"] != null) { facilityTypeIDRef_ = facilityTypeNode.Attributes["id"].Value; FacilityType ob = new FacilityType(facilityTypeNode); IDManager.SetID(facilityTypeIDRef_, ob); } else if (facilityTypeNode.Attributes["href"] != null) { facilityTypeIDRef_ = facilityTypeNode.Attributes["href"].Value; } else { facilityType_ = new FacilityType(facilityTypeNode); } } else { facilityType_ = new FacilityType(facilityTypeNode); } } XmlNode maturityNode = xmlNode.SelectSingleNode("maturity"); if (maturityNode != null) { if (maturityNode.Attributes["href"] != null || maturityNode.Attributes["id"] != null) { if (maturityNode.Attributes["id"] != null) { maturityIDRef_ = maturityNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(maturityNode); IDManager.SetID(maturityIDRef_, ob); } else if (maturityNode.Attributes["href"] != null) { maturityIDRef_ = maturityNode.Attributes["href"].Value; } else { maturity_ = new XsdTypeDate(maturityNode); } } else { maturity_ = new XsdTypeDate(maturityNode); } } XmlNode creditAgreementDateNode = xmlNode.SelectSingleNode("creditAgreementDate"); if (creditAgreementDateNode != null) { if (creditAgreementDateNode.Attributes["href"] != null || creditAgreementDateNode.Attributes["id"] != null) { if (creditAgreementDateNode.Attributes["id"] != null) { creditAgreementDateIDRef_ = creditAgreementDateNode.Attributes["id"].Value; XsdTypeDate ob = new XsdTypeDate(creditAgreementDateNode); IDManager.SetID(creditAgreementDateIDRef_, ob); } else if (creditAgreementDateNode.Attributes["href"] != null) { creditAgreementDateIDRef_ = creditAgreementDateNode.Attributes["href"].Value; } else { creditAgreementDate_ = new XsdTypeDate(creditAgreementDateNode); } } else { creditAgreementDate_ = new XsdTypeDate(creditAgreementDateNode); } } XmlNode trancheNode = xmlNode.SelectSingleNode("tranche"); if (trancheNode != null) { if (trancheNode.Attributes["href"] != null || trancheNode.Attributes["id"] != null) { if (trancheNode.Attributes["id"] != null) { trancheIDRef_ = trancheNode.Attributes["id"].Value; UnderlyingAssetTranche ob = new UnderlyingAssetTranche(trancheNode); IDManager.SetID(trancheIDRef_, ob); } else if (trancheNode.Attributes["href"] != null) { trancheIDRef_ = trancheNode.Attributes["href"].Value; } else { tranche_ = new UnderlyingAssetTranche(trancheNode); } } else { tranche_ = new UnderlyingAssetTranche(trancheNode); } } }
public Loan(XmlNode xmlNode) : base(xmlNode) { XmlNodeList borrowerNodeList = xmlNode.SelectNodes("borrower"); if (borrowerNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in borrowerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { borrowerIDRef = item.Attributes["id"].Name; LegalEntity ob = LegalEntity(); IDManager.SetID(borrowerIDRef, ob); } else if (item.Attributes.ToString() == "href") { borrowerIDRef = item.Attributes["href"].Name; } else { borrower = new LegalEntity(item); } } } XmlNodeList borrowerReferenceNodeList = xmlNode.SelectNodes("borrowerReference"); if (borrowerReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in borrowerReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { borrowerReferenceIDRef = item.Attributes["id"].Name; LegalEntityReference ob = LegalEntityReference(); IDManager.SetID(borrowerReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { borrowerReferenceIDRef = item.Attributes["href"].Name; } else { borrowerReference = new LegalEntityReference(item); } } } XmlNodeList lienNodeList = xmlNode.SelectNodes("lien"); if (lienNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in lienNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { lienIDRef = item.Attributes["id"].Name; Lien ob = Lien(); IDManager.SetID(lienIDRef, ob); } else if (item.Attributes.ToString() == "href") { lienIDRef = item.Attributes["href"].Name; } else { lien = new Lien(item); } } } XmlNodeList facilityTypeNodeList = xmlNode.SelectNodes("facilityType"); if (facilityTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in facilityTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { facilityTypeIDRef = item.Attributes["id"].Name; FacilityType ob = FacilityType(); IDManager.SetID(facilityTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { facilityTypeIDRef = item.Attributes["href"].Name; } else { facilityType = new FacilityType(item); } } } XmlNodeList maturityNodeList = xmlNode.SelectNodes("maturity"); if (maturityNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in maturityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { maturityIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(maturityIDRef, ob); } else if (item.Attributes.ToString() == "href") { maturityIDRef = item.Attributes["href"].Name; } else { maturity = new XsdTypeDate(item); } } } XmlNodeList creditAgreementDateNodeList = xmlNode.SelectNodes("creditAgreementDate"); if (creditAgreementDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in creditAgreementDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { creditAgreementDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(creditAgreementDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { creditAgreementDateIDRef = item.Attributes["href"].Name; } else { creditAgreementDate = new XsdTypeDate(item); } } } XmlNodeList trancheNodeList = xmlNode.SelectNodes("tranche"); if (trancheNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in trancheNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { trancheIDRef = item.Attributes["id"].Name; UnderlyingAssetTranche ob = UnderlyingAssetTranche(); IDManager.SetID(trancheIDRef, ob); } else if (item.Attributes.ToString() == "href") { trancheIDRef = item.Attributes["href"].Name; } else { tranche = new UnderlyingAssetTranche(item); } } } }
public Loan(XmlNode xmlNode) : base(xmlNode) { XmlNodeList borrowerNodeList = xmlNode.SelectNodes("borrower"); if (borrowerNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in borrowerNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { borrowerIDRef = item.Attributes["id"].Name; LegalEntity ob = LegalEntity(); IDManager.SetID(borrowerIDRef, ob); } else if (item.Attributes.ToString() == "href") { borrowerIDRef = item.Attributes["href"].Name; } else { borrower = new LegalEntity(item); } } } XmlNodeList borrowerReferenceNodeList = xmlNode.SelectNodes("borrowerReference"); if (borrowerReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in borrowerReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { borrowerReferenceIDRef = item.Attributes["id"].Name; LegalEntityReference ob = LegalEntityReference(); IDManager.SetID(borrowerReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { borrowerReferenceIDRef = item.Attributes["href"].Name; } else { borrowerReference = new LegalEntityReference(item); } } } XmlNodeList lienNodeList = xmlNode.SelectNodes("lien"); if (lienNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in lienNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { lienIDRef = item.Attributes["id"].Name; Lien ob = Lien(); IDManager.SetID(lienIDRef, ob); } else if (item.Attributes.ToString() == "href") { lienIDRef = item.Attributes["href"].Name; } else { lien = new Lien(item); } } } XmlNodeList facilityTypeNodeList = xmlNode.SelectNodes("facilityType"); if (facilityTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in facilityTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { facilityTypeIDRef = item.Attributes["id"].Name; FacilityType ob = FacilityType(); IDManager.SetID(facilityTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { facilityTypeIDRef = item.Attributes["href"].Name; } else { facilityType = new FacilityType(item); } } } XmlNodeList maturityNodeList = xmlNode.SelectNodes("maturity"); if (maturityNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in maturityNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { maturityIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(maturityIDRef, ob); } else if (item.Attributes.ToString() == "href") { maturityIDRef = item.Attributes["href"].Name; } else { maturity = new XsdTypeDate(item); } } } XmlNodeList creditAgreementDateNodeList = xmlNode.SelectNodes("creditAgreementDate"); if (creditAgreementDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in creditAgreementDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { creditAgreementDateIDRef = item.Attributes["id"].Name; XsdTypeDate ob = XsdTypeDate(); IDManager.SetID(creditAgreementDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { creditAgreementDateIDRef = item.Attributes["href"].Name; } else { creditAgreementDate = new XsdTypeDate(item); } } } XmlNodeList trancheNodeList = xmlNode.SelectNodes("tranche"); if (trancheNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in trancheNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { trancheIDRef = item.Attributes["id"].Name; UnderlyingAssetTranche ob = UnderlyingAssetTranche(); IDManager.SetID(trancheIDRef, ob); } else if (item.Attributes.ToString() == "href") { trancheIDRef = item.Attributes["href"].Name; } else { tranche = new UnderlyingAssetTranche(item); } } } }