/// <summary>
        /// Validate the entered data and close the dialog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void onOk(object sender, EventArgs e)
        {
            m_condition = new Condition();
            String      value;
            Professions profession;
            Races       race;

            CommonTools.ConditionType conditionType = (CommonTools.ConditionType)guiTypeCbo.SelectedItem;
            m_condition.setConditionType(conditionType);
            switch (conditionType)
            {
            case CommonTools.ConditionType.Overall_Level:
            case CommonTools.ConditionType.Combat_Level:
            case CommonTools.ConditionType.Explore_Level:
            case CommonTools.ConditionType.Trade_Level:
            case CommonTools.ConditionType.Hull_Level:
                m_condition.setValue(guiAmountTxt.Text);
                break;

            case CommonTools.ConditionType.Faction_Required:
            case CommonTools.ConditionType.Item_Required:
                m_condition.setValue(guiAmountTxt.Text);
                m_condition.setFlag(guiCodeTxt.Text);
                break;

            case CommonTools.ConditionType.Profession:
                // Impossible to enter an invalid value
                profession = (Professions)guiValueCbo.SelectedItem;
                value      = ((int)profession).ToString();
                m_condition.setValue(value);
                break;

            case CommonTools.ConditionType.Race:
                // Impossible to enter an invalid value
                race  = (Races)guiValueCbo.SelectedItem;
                value = ((int)race).ToString();
                m_condition.setValue(value);
                break;

            case CommonTools.ConditionType.Mission_Required:
                m_condition.setValue(guiCodeTxt.Text);
                break;
            }

            String error;

            m_condition.addValidations();
            // Cannot perform a full validation since we could validate that there's at least
            // one condition when we're in the process of creating that first condition
            if (Database.DataConfiguration.validate(out error))
            {
                m_madeSelection = true;
                this.Close();
            }
            else
            {
                MessageBox.Show(error);
            }
        }
        private void onTypeSelected(object sender, EventArgs e)
        {
            guiValueCbo.Items.Clear();
            guiValueCbo.Enabled      = false;
            guiCodeTxt.Enabled       = false;
            guiCodeSearchBtn.Enabled = false;
            guiAmountTxt.Enabled     = false;

            CommonTools.ConditionType conditionType = (CommonTools.ConditionType)guiTypeCbo.SelectedItem;
            switch (conditionType)
            {
            case CommonTools.ConditionType.Overall_Level:
            case CommonTools.ConditionType.Combat_Level:
            case CommonTools.ConditionType.Explore_Level:
            case CommonTools.ConditionType.Trade_Level:
            case CommonTools.ConditionType.Hull_Level:
                guiAmountTxt.Enabled = true;
                break;

            case CommonTools.ConditionType.Faction_Required:
                guiCodeTxt.Enabled       = true;
                guiCodeSearchBtn.Enabled = true;
                guiAmountTxt.Enabled     = true;
                m_codeSearch.setDataType(DataConfiguration.DataType.faction);
                break;

            case CommonTools.ConditionType.Item_Required:
                guiCodeTxt.Enabled       = true;
                guiCodeSearchBtn.Enabled = true;
                guiAmountTxt.Enabled     = true;
                m_codeSearch.setDataType(DataConfiguration.DataType.item);
                break;

            case CommonTools.ConditionType.Profession:
                guiValueCbo.Enabled = true;
                guiValueCbo.Items.Clear();
                CommonTools.Enumeration.AddSortedByName <Professions>(guiValueCbo);
                guiValueCbo.SelectedIndex = 0;
                break;

            case CommonTools.ConditionType.Race:
                guiValueCbo.Enabled = true;
                guiValueCbo.Items.Clear();
                CommonTools.Enumeration.AddSortedByName <Races>(guiValueCbo);
                guiValueCbo.SelectedIndex = 0;
                break;

            case CommonTools.ConditionType.Mission_Required:
                guiCodeTxt.Enabled       = true;
                guiCodeSearchBtn.Enabled = true;
                m_codeSearch.setDataType(DataConfiguration.DataType.mission);
                break;
            }
        }