Example #1
0
        private void Init()
        {
            try
            {
                _Validator = new ValidationTools();
            }
            catch (Exception ex)
            {
                MessageBoxEnhanced.Error(ex.Message);
                return;
            }

            // Title ComboBox
            cbTitle.ItemsSource = DataModel.Title.GetTitles();

            // FundingType ComboBox
            cBFundingTyp.ItemsSource = FundingType.GetFundingTypes();

            gbCompanySponsor.Visibility = System.Windows.Visibility.Collapsed;
            gbCompanySponsor.IsEnabled  = false;
        }
Example #2
0
        /// <summary>
        /// Wird aufgerufen wenn eine Personen-Art (Kinder, Sponsor...) ausgewählt wurde.
        /// </summary>
        /// <param name="sender">Die geschlossene ComboBox</param>
        private void cbPerson_DropDownClosed(object sender, EventArgs e)
        {
            //Reset GUI
            lCount.Content    = "";
            bSearch.IsEnabled = false;
            bPrint.IsEnabled  = false;
            displayedDataPage.resetAll();
            dGAnyStatistics.ItemsSource = null;


            //Clear Comboboxes before refilling
            cbOther.Items.Clear();
            foreach (ComboBox cb in displayedDataComboBoxes)
            {
                cb.Items.Clear();
            }


            //Clear WrapPanel DynamicContent
            if (wPDynamicContent.Count != 0)
            {
                removeWPDynamicContent();
            }

            //Fill cbOther and update displayaedDataComboBoxes
            switch (cbPerson.Text)
            {
            case "Sponsoren":
                foreach (FundingType type in FundingType.GetFundingTypes())
                {
                    cbOther.Items.Add(type.Name);
                }
                displayedDataPage.setDisplayableData(displayableDataSponsor);
                break;

            case "Ausweisinhaber":
                foreach (string item in attributesPassHolder)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                displayedDataPage.setDisplayableData(displayableDataPassHolder);
                break;

            case "Kinder":
                foreach (string item in attributesChildren)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                displayedDataPage.setDisplayableData(displayableDataChildren);
                break;

            default:
                foreach (string item in attributesPartnersAll)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                displayedDataPage.setDisplayableData(displayableDataPartnersAll);
                break;
            }
            if (!String.IsNullOrEmpty(cbPerson.Text))
            {
                cbOther.IsEnabled = true;
            }
        }
Example #3
0
        private void cbPerson_DropDownClosed(object sender, EventArgs e)
        {
            //Clear Comboboxes before refilling
            cbOther.Items.Clear();
            foreach (ComboBox cb in displayedDataComboBoxes)
            {
                cb.Items.Clear();
            }


            //Clear WrapPanel DynamicContent
            if (wPDynamicContent.Count != 0)
            {
                removeWPDynamicContent();
            }

            //Fill cbOther and update displayaedDataComboBoxes
            switch (cbPerson.Text)
            {
            case "Sponsoren":
                ComboBox cBSponsor = wPAddComboBox();
                cBSponsor.Width = 130;
                foreach (FundingType type in FundingType.GetFundingTypes())
                {
                    cBSponsor.Items.Add(type.Name);
                }
                addItemsToComboBoxes(displayableDataSponsor, displayedDataComboBoxes);
                break;

            case "Ausweisinhaber":
                foreach (string item in cbOtherItemsPassHolder)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                addItemsToComboBoxes(displayableDataPassHolder, displayedDataComboBoxes);
                break;

            case "Kinder":
                foreach (string item in cbOtherItemsChildren)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                addItemsToComboBoxes(displayableDataChildren, displayedDataComboBoxes);
                break;

            default:
                foreach (string item in cbOtherItemsPartnersAll)
                {
                    cbOther.Items.Add(item);
                }
                cbOther.Width = 210;
                addItemsToComboBoxes(displayableDataPartnersAll, displayedDataComboBoxes);
                break;
            }
            if (cbPerson.Text != "")
            {
                cbOther.IsEnabled = true;
            }
        }