private void selectContact(ContactProxy contact)
 {
     try
     {
         if (!contactComboList.Exists(scl => scl.ID == contact.ID))
         {
             contactComboList.Add(contact);
         }
         ContactCombo.SelectedItem = contactComboList.FirstOrDefault(scl => scl.ID == contact.ID);
     }
     catch (Exception generalException) { MessageFunctions.Error("Error displaying selected contact in the list", generalException); }
 }
 private void chooseContactName(int contactID = 0)
 {
     try
     {
         ContactProxy selectedContact = (contactID != 0) ? ClientFunctions.GetContactProxy(contactID) : (ContactProxy)PossibleNames.SelectedItem;
         NameLike.Text = selectedContact.ContactName;
         setCurrentClient(selectedContact.Client, null);
         exactName = true;
         nameFilter();
     }
     catch (Exception generalException) { MessageFunctions.Error("Error processing contact name selection", generalException); }
 }
 private void ContactDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (ContactDataGrid.SelectedItem != null)
         {
             selectedContactGridRecord = (ContactProxy)ContactDataGrid.SelectedItem;
             AmendButton.IsEnabled     = true;
             selectedContact           = ClientFunctions.GetContact(selectedContactGridRecord.ID);
             AmendButton.ToolTip       = "Amend " + selectedContact.FullName + "'s details";
             toggleActiveButton(selectedContact.Active);
         }
         else
         {
             clearContactSelection();
         }
     }
     catch (Exception generalException)
     {
         MessageFunctions.Error("Error processing client selection", generalException);
         clearContactSelection();
     }
 }
 private void clearContactSelection()
 {
     selectedContactGridRecord = null;
     selectedContact           = null;
     AmendButton.IsEnabled     = DisableButton.IsEnabled = false;
 }