private string GetContactValue(Entities.ContactCollection contacts, eContactType type) { string contactValue = String.Empty; if (contacts != null) { Entities.Contact tempContact = contacts.GetForContactType(type); if (tempContact != null) { contactValue = tempContact.ContactDetail; } } return(contactValue); }
private DataSet GetContactDataSet(List <Entities.Individual> individualContacts, eContactType contactType) { DataSet contactsDataSet = new DataSet(); DataTable contactTable = new DataTable("contactTable"); string contactNameColumn = "ContactName"; string contactDetailColumn = "ContactDetail"; string ContactDisplayColumn = "ContactDisplay"; contactTable.Columns.Add(contactNameColumn); contactTable.Columns.Add(contactDetailColumn); contactTable.Columns.Add(ContactDisplayColumn); contactsDataSet.Tables.Add(contactTable); foreach (Entities.Individual individual in individualContacts) { if (individual.Contacts != null) { Entities.Contact contact = individual.Contacts.GetForContactType(contactType); if (contact != null) { DataRow row = contactsDataSet.Tables[0].NewRow(); row[contactNameColumn] = String.Format("{0} {1} {2}", individual.Title, individual.FirstNames, individual.LastName); row[contactDetailColumn] = contact.ContactDetail; row[ContactDisplayColumn] = String.Format("{0} - {1}", row[contactNameColumn], row[contactDetailColumn]); contactsDataSet.Tables[0].Rows.Add(row); } } } return(contactsDataSet); }
public ContactInfo(int contactId, eContactType type, string value) { this.ContactId = contactId; this.Type = type; this.Value = value; }