/// <summary>
        /// Sets up the client.
        /// </summary>
        private void SetupClient()
        {
            //Get the client type
            _ddlMatterType.Enabled = true;
            _txtDescription.Enabled = true;
            _ddlBranch.Enabled = true;
            _ddlDepartment.Enabled = true;
            _ddlWorkType.Enabled = true;
            _ddlFeeEarner.Enabled = true;
            _ccUFNDate.Enabled = true;
            _txtHOUCN.Enabled = true;
            _txtUCN.Enabled = true;

            ClientServiceClient clientService = null;
            try
            {
                Guid memberId = (Guid)Session[SessionName.MemberId];
                Guid organisationId = (Guid)Session[SessionName.OrganisationId];
                Guid clientId;
                bool isMember;
                if (memberId != DataConstants.DummyGuid)
                {
                    clientId = memberId;
                    isMember = true;
                }
                else
                {
                    clientId = organisationId;
                    isMember = false;
                }

                clientService = new ClientServiceClient();
                ClientReturnValue returnValue = clientService.GetClientDefaults(_logonSettings.LogonId,
                                        clientId);

                if (returnValue.Success)
                {
                    if (returnValue.Client != null)
                    {
                        ViewState[ClientType] = returnValue.Client.TypeId;
                        //Set the default branch for the selected client
                        _ddlBranch.SelectedIndex = -1;
                        if (returnValue.Client.Branch != string.Empty)
                        {
                            foreach (ListItem branch in _ddlBranch.Items)
                            {
                                if (branch.Value != string.Empty && GetBranchValueOnIndex(branch.Value, 0) == returnValue.Client.Branch.Trim())
                                {
                                    branch.Selected = true;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            _ddlBranch.SelectedValue = string.Empty;
                        }
                        SetupClientType(returnValue.Client.TypeId);

                        //Display joint candidates
                        if (_chklstClientAssociates.Visible)
                        {
                            GetJointClientCandidates(clientId, isMember);
                        }

                        //Get the matter types based on the client type
                        GetMatterTypes();
                        SetupUserDefaults();
                        SetWorkTypeDefaults();

                    }
                    else
                    {
                        throw new Exception("Unable to load client defaults");
                    }
                }
                else
                {
                    _ddlMatterType.Enabled = false;
                    _txtDescription.Enabled = false;
                    _ddlBranch.Enabled = false;
                    _ddlDepartment.Enabled = false;
                    _ddlWorkType.Enabled = false;
                    _ddlFeeEarner.Enabled = false;
                    _ccUFNDate.Enabled = false;
                    _txtHOUCN.Enabled = false;
                    _txtUCN.Enabled = false;

                    _txtDescription.Text = string.Empty;
                    _ddlBranch.SelectedValue = string.Empty;
                    _ddlDepartment.Items.Clear();
                    _ddlWorkType.Items.Clear();

                    throw new Exception(returnValue.Message.Replace("Client Archived", "Matter can not be added to an archived client"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (clientService != null)
                {
                    if (clientService.State != System.ServiceModel.CommunicationState.Faulted)
                        clientService.Close();
                }
            }
        }