Beispiel #1
0
        private void pbNewChild_Click(object sender, RoutedEventArgs e)
        {
            //checkPersonTab();
            if (this._PersonIsValid == true)
            {
                pEditClientPartnerChild pPartnerChild = getPageFromTabs <pEditClientPartnerChild>();
                TabControl tC              = this.parentTabControl;
                var        tab             = tC.Items.GetItemAt(1);
                Control    childPartnerTab = ((Control)tab);
                childPartnerTab.IsEnabled = true;

                pPartnerChild.addNewChildtoDatagrid();
                ((TabItem)tC.Items.GetItemAt(1)).Focus();
            }
            else
            {
                getErrorMsg();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Generiert die Untertabs und deren ToolbarContent zum Editieren eines Kunden
        ///
        /// Author: Antonios Fesenmeier, Georg Schmid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditPersonButton_Click(object sender, RoutedEventArgs e)
        {
            //Setzt den Rücksprungwert für das Paging
            pagingStartValue = _DataGridPaging.getStartOfDataGridItems();

            Person currentPerson = ClientDataGrid.SelectedItem as Person;

            // Tabs hinzufügen
            KPage         person    = new KöTaf.WPFApplication.Views.Client.pEditClientPerson(currentPerson);
            SimpleTabItem tabPerson = new SimpleTabItem(IniParser.GetSetting("CLIENT", "personalData"), person);

            this._myTabListEdit.Add(tabPerson);

            KPage         partnerChild    = new KöTaf.WPFApplication.Views.Client.pEditClientPartnerChild(currentPerson);
            SimpleTabItem tabPartnerChild = new SimpleTabItem(IniParser.GetSetting("CLIENT", "partnerAndChildren"), partnerChild);

            this._myTabListEdit.Add(tabPartnerChild);

            KPage         revenues    = new KöTaf.WPFApplication.Views.Client.pEditClientRevenues(currentPerson);
            SimpleTabItem tabRevenues = new SimpleTabItem(IniParser.GetSetting("CLIENT", "revenue"), revenues);

            this._myTabListEdit.Add(tabRevenues);

            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            SinglePage singlePage = new SinglePage(this, IniParser.GetSetting("CLIENT", "editClient"), this._myTabListEdit);
        }
        /// <summary>
        /// Generiert die Untertabs und deren ToolbarContent zum Editieren eines Kunden
        /// 
        /// Author: Antonios Fesenmeier, Georg Schmid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditPersonButton_Click(object sender, RoutedEventArgs e)
        {
            //Setzt den Rücksprungwert für das Paging
            pagingStartValue = _DataGridPaging.getStartOfDataGridItems();

            Person currentPerson = ClientDataGrid.SelectedItem as Person;

            // Tabs hinzufügen
            KPage person = new KöTaf.WPFApplication.Views.Client.pEditClientPerson(currentPerson);
            SimpleTabItem tabPerson = new SimpleTabItem(IniParser.GetSetting("CLIENT", "personalData"), person);
            this._myTabListEdit.Add(tabPerson);

            KPage partnerChild = new KöTaf.WPFApplication.Views.Client.pEditClientPartnerChild(currentPerson);
            SimpleTabItem tabPartnerChild = new SimpleTabItem(IniParser.GetSetting("CLIENT", "partnerAndChildren"), partnerChild);
            this._myTabListEdit.Add(tabPartnerChild);

            KPage revenues = new KöTaf.WPFApplication.Views.Client.pEditClientRevenues(currentPerson);
            SimpleTabItem tabRevenues = new SimpleTabItem(IniParser.GetSetting("CLIENT", "revenue"), revenues);
            this._myTabListEdit.Add(tabRevenues);

            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), pbAbort_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "back"), pbBack_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "next"), pbNextEdit_Click);
            tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSaveEdit_Click);

            SinglePage singlePage = new SinglePage(this, IniParser.GetSetting("CLIENT", "editClient"), this._myTabListEdit);
        }
Beispiel #4
0
        public void EnableTabs()
        {
            if (this._PersonIsValid == true)
            {
                Boolean haveChild = false, havePartner = false;
                int     childs = Convert.ToInt32(txtChildrens.Content);

                pEditClientPartnerChild pPartnerChild = getPageFromTabs <pEditClientPartnerChild>();

                // Wurde angegeben dass Kinder vorhanden sind, wird die
                // entsprechende Gruppe von Controls enabled
                if (childs > 0)
                {
                    pPartnerChild.GrBChildren.IsEnabled = true;
                    haveChild = true;
                }
                else
                {
                    pPartnerChild.GrBChildren.IsEnabled = false;
                }

                DB.FamilyState fS = cbFamilyState.SelectedItem as DB.FamilyState;

                if (fS.ShortName.Equals("VH") || fS.ShortName.Equals("LP"))
                {
                    pPartnerChild.GrBPartner.IsEnabled = true;
                    havePartner = true;

                    //KinderGroupbox aktivieren, damit Kinder hinzugefügt werden können
                    pPartnerChild.GrBChildren.IsEnabled = true;


                    //Daten des Partners eintragen
                    var titles = DataModel.Title.GetTitles().ToList();
                    pPartnerChild.cbTitle1.ItemsSource = titles;
                    if (_currentPerson.MaritalTitle != null)
                    {
                        pPartnerChild.cbTitle1.SelectedIndex = titles.FindIndex(t => t.TitleID == _currentPerson.MaritalTitle.TitleID);
                    }
                    if (_currentPerson.MaritalBirthday != null)
                    {
                        pPartnerChild.dpBirthday1.SelectedDate = _currentPerson.MaritalBirthday;
                    }
                }
                else
                {
                    pPartnerChild.GrBPartner.IsEnabled = false;
                    havePartner = false;

                    //Daten für Partner löschen

                    pPartnerChild.cbTitle1.SelectedIndex   = 0;
                    pPartnerChild.txtFirstName1.Text       = "";
                    pPartnerChild.txtLastName1.Text        = "";
                    pPartnerChild.txtNationalCountry1.Text = "";

                    //Datum auf leer setzten
                    //pPartnerChild.dpBirthday1.SelectedDate = DateTime.Now;

                    pPartnerChild.txtNativeCountry1.Text = "";
                    pPartnerChild.txtTelno1.Text         = "";
                    pPartnerChild.txtMobileNo1.Text      = "";
                    pPartnerChild.txtEmail1.Text         = "";
                }

                TabControl tC              = this.parentTabControl;
                var        tab             = tC.Items.GetItemAt(1);
                Control    childPartnerTab = ((Control)tab);


                tab = tC.Items.GetItemAt(2);
                Control revenuesTab = ((Control)tab);

                if (haveChild == true || havePartner == true)
                {
                    childPartnerTab.IsEnabled = true;
                    return;
                }
                else
                {
                    childPartnerTab.IsEnabled = false;
                    revenuesTab.IsEnabled     = true;
                }
            }
        }