public ValidationResultSDNPLC(sdnListSdnEntry entry)
    {
      ValidationName = SDN_STR;
      Uid = entry.uid.ToString();
      Name = entry.firstName + " " + entry.lastName;
      StringBuilder akaNames = new StringBuilder();
			if (entry.akaList != null)
			{
				foreach (var el in entry.akaList)
				{
					if (el != entry.akaList.Last())
					{
						akaNames.Append(el.firstName + " " + el.lastName + ", ");
					}
					else
					{
						akaNames.Append(el.firstName + " " + el.lastName);
					}
				}
			}
      AkaNames = akaNames.ToString();
      StringBuilder addresses = new StringBuilder();
      if (entry.addressList != null)
      {
        foreach (var el in entry.addressList)
        {
          if (el != entry.addressList.Last())
          {
            addresses.Append(el.country + " " + el.stateOrProvince + " " + el.postalCode + " " + el.address1 + " " + el.address2 + " " + el.address3 + ", ");
          }
          else
          {
            addresses.Append(el.country + " " + el.stateOrProvince + " " + el.postalCode + " " + el.address1 + " " + el.address2 + " " + el.address3);
          }
        }
      }
      Addresses = addresses.ToString();

      StringBuilder nationality = new StringBuilder();
      if (entry.nationalityList != null)
      {
        foreach (var el in entry.nationalityList)
        {
          if (el != entry.nationalityList.Last())
          {
            nationality.Append(el.country + ", ");
          }
          else
          {
            nationality.Append(el.country);
          }
        }
      }
      Nationality = nationality.ToString();

      StringBuilder citizenship = new StringBuilder();
      if (entry.citizenshipList != null)
      {
        foreach (var el in entry.citizenshipList)
        {
          if (el != entry.citizenshipList.Last())
          {
            citizenship.Append(el.country + ", ");
          }
          else
          {
            citizenship.Append(el.country);
          }
        }
      }
      Citizenship = citizenship.ToString();

      StringBuilder dateOfBirth = new StringBuilder();
      if (entry.dateOfBirthList != null)
      {
        foreach (var el in entry.dateOfBirthList)
        {
          if (el != entry.dateOfBirthList.Last())
          {
            dateOfBirth.Append(el.dateOfBirth + ", ");
          }
          else
          {
            dateOfBirth.Append(el.dateOfBirth);
          }
        }
      }
      DateOfBirth = dateOfBirth.ToString();

      StringBuilder placeOfBirth = new StringBuilder();
      if (entry.placeOfBirthList != null)
      {
        foreach (var el in entry.placeOfBirthList)
        {
          if (el != entry.placeOfBirthList.Last())
          {
            placeOfBirth.Append(el.placeOfBirth + ", ");
          }
          else
          {
            placeOfBirth.Append(el.placeOfBirth);
          }
        }
      }
      PlaceOfBirth = placeOfBirth.ToString();

      StringBuilder program = new StringBuilder();
      if (entry.programList != null)
      {
        foreach (var el in entry.programList)
        {
          if (el != entry.programList.Last())
          {
            program.Append(el + ", ");
          }
          else
          {
            program.Append(el);
          }
        }
      }
      Program = program.ToString();

      if (entry.remarks != null)
        Remarks = entry.remarks;
      else Remarks = "";

      StringBuilder idList = new StringBuilder();
      if (entry.idList != null)
      {
        foreach (var el in entry.idList)
        {
          if (el != entry.idList.Last())
          {
            idList.Append(el.idType + " " + el.idNumber + " " + el.idCountry + " " + el.issueDate + " " + el.expirationDate + ", ");
          }
          else
          {
            idList.Append(el.idType + " " + el.idNumber + " " + el.idCountry + " " + el.issueDate + " " + el.expirationDate);
          }
        }
      }
      IdList = idList.ToString();

    }
Example #2
0
		public XElement GetXmlSDN(sdnListSdnEntry[] sdn)
		{

			XmlSerializer xmlSerializer = new XmlSerializer(typeof(sdnListSdnEntry[]));
			using (Stream stream = new MemoryStream())
			{
				try
				{
					xmlSerializer.Serialize(stream, sdn);
					stream.Position = 0;
					var element = XElement.Load(stream);
					return element;
				}
				catch (InvalidOperationException)
				{
					throw;
				}
			}
		}