public int Run() { Console.WriteLine("Loading List Services address with phone numbers records..."); var phoneNumbers = AddressCsvLoader.LoadFrom(PhoneNumbers); var addresses = AlbaAddressExport.LoadFrom(Addresses); Console.WriteLine($"Phone Number Record Count: {phoneNumbers.Count()}"); var results = AddressCsvLoader.AddPhoneNumbers1And2( numbers: phoneNumbers, addresses: addresses, territoryId: PhoneTerritoryId); foreach (var address in results.SuccessfulAddresses) { Console.WriteLine($"{address.Address}: {address.Notes}"); } Console.WriteLine("Errors:"); foreach (var error in results.Errors) { Console.WriteLine($"{error.Address_ID}: {error.Address} {error.Phone1}, {error.Phone2}"); } LoadCsvAddresses.SaveTo(results.SuccessfulAddresses, OutputFilePath); return(0); }
public static AlbaAddressImport From(AlbaAddressExport export) { return(new AlbaAddressImport { Address_ID = export.Address_ID, Territory_ID = export.Territory_ID, Language = export.Language, Status = export.Status, Name = export.Name, Suite = export.Suite, Address = export.Address, City = export.City, Province = export.Province, Postal_code = export.Postal_code, Country = export.Country, Latitude = export.Latitude, Longitude = export.Longitude, Telephone = export.Telephone, Notes = export.Notes, Notes_private = export.Notes_private }); }