Esempio n. 1
0
        /// <inheritdoc />
        public override void AddAddress(AddressRecord record)
        {
            var builder = new StringBuilder(512); // The CSV format of the PAF has a 490 maximum

            OrganisationRecord organisation = GetRelated(record.OrganisationKey, this.organisations);

            if (organisation != null)
            {
                builder.Append(organisation.Name)
                .Append(' ')
                .Append(organisation.Department)
                .Append(' ');
            }

            if (record.BuildingNumber != null)
            {
                builder.Append(record.BuildingNumber)
                .Append(' ');
            }

            builder.Append(GetRelated(record.BuildingNameKey, this.buildingNames))
            .Append(' ')
            .Append(GetRelated(record.SubBuildingNameKey, this.subBuildingNames))
            .Append(' ');

            builder.Append(GetRelated(record.DependentThoroughfareKey, this.thoroughfares))
            .Append(' ')
            .Append(GetRelated(record.DependentThoroughfareDescriptorKey, this.descriptors))
            .Append(' ')
            .Append(GetRelated(record.ThoroughfareKey, this.thoroughfares))
            .Append(' ')
            .Append(GetRelated(record.ThoroughfareDescriptorKey, this.descriptors))
            .Append(' ')
            .Append(record.POBoxNumber)
            .Append(' ');

            LocalityRecord locality = GetRelated(record.LocalityKey, this.localities);

            if (locality != null)
            {
                builder.Append(locality.DoubleDependentLocality)
                .Append(' ')
                .Append(locality.DependentLocality)
                .Append(' ')
                .Append(locality.PostTown);
            }

            this.addresses[record.Key] = builder.ToString();
        }
Esempio n. 2
0
 /// <inheritdoc />
 public override void AddLocality(LocalityRecord record)
 {
     this.localities[record.Key] = record;
 }