Пример #1
0
        private void cbOther_DropDownClosed(object sender, EventArgs e)
        {
            if (wPDynamicContent.Count != 0)
            {
                removeWPDynamicContent();
            }

            //Fill cbOther
            switch (cbOther.Text)
            {
            case "Ausweisgültigkeit bis max.":
                wPAddDatePicker();
                break;

            case "Familienstand":
                ComboBox cBF = wPAddComboBox();
                cBF.Width = 230;
                foreach (FamilyState state in FamilyState.GetFamilyStates())
                {
                    cBF.Items.Add(state.Name);
                }
                break;

            case "Anzahl Kinder":
                UIElement[] array  = wPAddFromTo();
                ComboBox    cBFrom = (ComboBox)array[0];
                ComboBox    cBTo   = (ComboBox)array[1];
                for (int i = 0; i < 20; i++)
                {
                    cBFrom.Items.Add(i);
                    cBTo.Items.Add(i);
                }
                break;

            case "Postleitzahl":
                tbInput = wPAddTextBox();
                break;

            case "Wohnort":
                tbInput = wPAddTextBox();
                break;

            case "Staatsangehörigkeit":
                tbInput = wPAddTextBox();
                break;

            case "Alter":
                ComboBox cBA = wPAddComboBox();
                cBA.Width = 60;
                for (int i = 1; i < 200; i++)
                {
                    cBA.Items.Add(i);
                }
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Wird aufgerufen wenn ein Attribut, nach dem gefiltert werden soll, ausgewählt wurde.
        /// </summary>
        /// <param name="sender">Die geschlossene ComboBox</param>
        private void cbOther_DropDownClosed(object sender, EventArgs e)
        {
            //Reset GUI
            lCount.Content    = "";
            bPrint.IsEnabled  = false;
            bSearch.IsEnabled = true;
            displayedDataPage.resetAll();
            dGAnyStatistics.ItemsSource = null;
            if (wPDynamicContent.Count != 0)
            {
                removeWPDynamicContent();
            }

            //Fill cbOther
            switch (cbOther.Text)
            {
            case "Ausweisgültigkeit bis max.":
                wPAddDatePicker();
                break;

            case "Familienstand":
                ComboBox cBF = wPAddComboBox();
                cBF.Width = 230;
                foreach (FamilyState state in FamilyState.GetFamilyStates())
                {
                    cBF.Items.Add(state.Name);
                }
                break;

            case "Anzahl Kinder":
                UIElement[] array  = wPAddFromTo();
                ComboBox    cBFrom = (ComboBox)array[0];
                ComboBox    cBTo   = (ComboBox)array[1];
                for (int i = 0; i < 20; i++)
                {
                    cBFrom.Items.Add(i);
                    cBTo.Items.Add(i);
                }
                break;

            case "Postleitzahl":
                wPAddTextBox();
                break;

            case "Wohnort":
                wPAddTextBox();
                break;

            case "Staatsangehörigkeit":
                wPAddTextBox();
                break;

            case "Alter":
                UIElement[] arrayAge  = wPAddFromTo();
                ComboBox    cBFromAge = (ComboBox)arrayAge[0];
                ComboBox    cBToAge   = (ComboBox)arrayAge[1];
                for (int i = 0; i < 150; i++)
                {
                    cBFromAge.Items.Add(i);
                    cBToAge.Items.Add(i);
                }
                break;

            case "Letzter Einkauf":
                wPAddFromToDate();
                break;
            }
            if (cbOther.Text != "")
            {
                ((ComboBox)displayedDataComboBoxes[0]).IsEnabled = true;
                bPrint.IsEnabled = false;
            }
        }