/// <summary> /// Gets the joint client candidates. /// </summary> private void GetJointClientCandidates(Guid clientId, bool isMember) { //Clear previous items _chklstClientAssociates.Items.Clear(); ClientServiceClient clientService = null; try { CollectionRequest collectionRequest = new CollectionRequest(); JointClientCandidateSearchCriteria criteria = new JointClientCandidateSearchCriteria(); criteria.ClientId = clientId; criteria.IsMember = isMember; clientService = new ClientServiceClient(); JointClientCandidateSearchReturnValue returnValue = clientService.JointClientCandidateSearch(_logonSettings.LogonId, collectionRequest, criteria); if (returnValue.Success) { foreach (JointClientCandidateSearchItem jointClientCandidate in returnValue.JointClientCandidates.Rows) { ListItem item = new ListItem(); item.Text = jointClientCandidate.Name; item.Value = jointClientCandidate.Tag; _chklstClientAssociates.Items.Add(item); } } else { throw new Exception(returnValue.Message); } } catch (Exception ex) { throw ex; } finally { if (clientService != null) { if (clientService.State != System.ServiceModel.CommunicationState.Faulted) clientService.Close(); } } }