Example #1
0
        private void WriteLocation(PLocationRow ALocationRow, PPartnerLocationRow APartnerLocationRow)
        {
            Write(ALocationRow.IsSiteKeyNull() ? 0 : ALocationRow.SiteKey);
            Write(ALocationRow.IsLocalityNull() ? "" : ALocationRow.Locality);
            Write(ALocationRow.IsStreetNameNull() ? "" : ALocationRow.StreetName);
            Write(ALocationRow.IsAddress3Null() ? "" : ALocationRow.Address3);
            WriteLine();
            Write(ALocationRow.IsCityNull() ? "" : ALocationRow.City);
            Write(ALocationRow.IsCountyNull() ? "" : ALocationRow.County);
            Write(ALocationRow.IsPostalCodeNull() ? "" : ALocationRow.PostalCode);
            Write(ALocationRow.IsCountryCodeNull() ? "" : ALocationRow.CountryCode);
            WriteLine();

            Write(APartnerLocationRow.IsDateEffectiveNull() ? "?" : APartnerLocationRow.DateEffective.Value.ToString(DATEFORMAT));
            Write(APartnerLocationRow.IsDateGoodUntilNull() ? "?" : APartnerLocationRow.DateGoodUntil.Value.ToString(DATEFORMAT));
            Write(APartnerLocationRow.IsLocationTypeNull() ? "" : APartnerLocationRow.LocationType);
            Write(APartnerLocationRow.IsSendMailNull() ? false : APartnerLocationRow.SendMail);
            Write(APartnerLocationRow.IsEmailAddressNull() ? "" : APartnerLocationRow.EmailAddress);
            Write(APartnerLocationRow.IsTelephoneNumberNull() ? "" : APartnerLocationRow.TelephoneNumber);
            Write(APartnerLocationRow.IsExtensionNull() ? 0 : APartnerLocationRow.Extension);
            Write(APartnerLocationRow.IsFaxNumberNull() ? "" : APartnerLocationRow.FaxNumber);
            Write(APartnerLocationRow.IsFaxExtensionNull() ? 0 : APartnerLocationRow.FaxExtension);
            WriteLine();
        }
Example #2
0
        private void WriteLocation(PLocationRow ALocationRow, PPartnerLocationRow APartnerLocationRow,
            TLocationPK ABestAddressPK)
        {
            string PhoneNumber;
            string EmailAddress;
            string FaxNumber;

            Write(ALocationRow.IsSiteKeyNull() ? 0 : ALocationRow.SiteKey);
            Write(ALocationRow.IsLocalityNull() ? "" : ALocationRow.Locality);
            Write(ALocationRow.IsStreetNameNull() ? "" : ALocationRow.StreetName);
            Write(ALocationRow.IsAddress3Null() ? "" : ALocationRow.Address3);
            WriteLine();
            Write(ALocationRow.IsCityNull() ? "" : ALocationRow.City);
            Write(ALocationRow.IsCountyNull() ? "" : ALocationRow.County);
            Write(ALocationRow.IsPostalCodeNull() ? "" : ALocationRow.PostalCode);
            Write(ALocationRow.IsCountryCodeNull() ? "" : ALocationRow.CountryCode);
            WriteLine();

            Write(APartnerLocationRow.IsDateEffectiveNull() ? "?" : APartnerLocationRow.DateEffective.Value.ToString(DATEFORMAT));
            Write(APartnerLocationRow.IsDateGoodUntilNull() ? "?" : APartnerLocationRow.DateGoodUntil.Value.ToString(DATEFORMAT));
            Write(APartnerLocationRow.IsLocationTypeNull() ? "" : APartnerLocationRow.LocationType);
            Write(APartnerLocationRow.IsSendMailNull() ? false : APartnerLocationRow.SendMail);

            if ((APartnerLocationRow.LocationKey == ABestAddressPK.LocationKey)
                && (APartnerLocationRow.SiteKey == ABestAddressPK.SiteKey))
            {
                // For the Location that is the 'Best Address' of the Partner we export 'Primary Phone Number',
                // 'Primary E-mail Address' and the 'Fax Number'.
                // They are exported for backwards compatibility as part of the 'Location' information as that is the only
                // place where the data was/is stored (and was/is seen and was/is maintained by the user) in Petra 2.x!
                TContactDetailsAggregate.GetPrimaryEmailAndPrimaryPhoneAndFax(APartnerLocationRow.PartnerKey,
                    out PhoneNumber, out EmailAddress, out FaxNumber);

                Write(EmailAddress ?? String.Empty);
                Write(PhoneNumber ?? String.Empty);
                Write(0);  // Phone Extensions are no longer kept in the Contact Details scheme so we can't export them...
                Write(FaxNumber ?? String.Empty);
                Write(0);  // Fax Extensions are no longer kept in the Contact Details scheme so we can't export them...
            }
            else
            {
                // For any Location that isn't the 'Best Address' of the Partner: Export empty data for EmailAddress,
                // PhoneNumber, (Phone) Extension, Fax and Fax Extension.
                Write(String.Empty);
                Write(String.Empty);
                Write(0);
                Write(String.Empty);
                Write(0);
            }

            WriteLine();
        }