private static void ShowContact(Contact contact) { // Show some information about the contact. Console.WriteLine("Found: {0} {1} ({4}); id: {2}; {3}", contact.FirstName, contact.LastName, contact.Id, contact.ContactType, contact.Gender); Console.WriteLine("Birth date: {0}", contact.BirthDate); Console.WriteLine("Deceased date: {0}", contact.DeceasedDate); Console.WriteLine("External ID: {0}", contact.ExternalIdentifier); Console.WriteLine("Mail Format: {0}", contact.PreferredMailFormat); }
private static void ShowAddresses(Contact c) { Console.WriteLine("\nAddresses:"); foreach (var a in c.AddressResult.Values) { Console.WriteLine( " Address {0}: {1}, {2} {5} {3} - {4},{6}", a.Id, a.StreetAddress, a.PostalCode, a.City, a.CountryId, a.PostalCodeSuffix, a.StateProvinceId); } }
private static void ShowCommunication(Contact contact) { if (contact.PhoneResult != null && contact.PhoneResult.Count > 0) { foreach (var p in contact.PhoneResult.Values) { Console.WriteLine("Phone ({0}): {1}", p.PhoneType, p.PhoneNumber); } } if (contact.EmailResult != null && contact.EmailResult.Count > 0) { foreach (var e in contact.EmailResult.Values) { Console.WriteLine("E-mail ({0}): {1}", e.LocationTypeId, e.EmailAddress); } } if (contact.WebsiteResult != null && contact.WebsiteResult.Count > 0) { foreach (var w in contact.WebsiteResult.Values) { Console.WriteLine("Website ({0}): {1}", w.WebsiteType, w.Url); } } if (contact.ImResult != null && contact.ImResult.Count > 0) { foreach (var im in contact.ImResult.Values) { Console.WriteLine("{0}: {1}", im.Provider, im.Name); } } }