コード例 #1
0
        private void pbPrintDisclaimer_Click(object sender, RoutedEventArgs e)
        {
            Person currentPerson = ClientDataGrid.SelectedItem as Person;

            PrintForms.printClientDisclaimer(currentPerson.PersonID);
        }
コード例 #2
0
 /// <summary>
 /// Haftungsausschluss
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btDisclaimer_Click(object sender, RoutedEventArgs e)
 {
     PrintForms.printClientDisclaimer();
 }
コード例 #3
0
        /// <summary>
        /// Überprüft alle Untertabs auf Vollständigkeit/ Korrektheit und speichert
        /// bei Korrektheit alle Kinder, Partner, die Person selbst und deren Einkommen
        /// mit allen Abhängigkeiten in die Datenbank
        ///
        /// Author: Antonios Fesenmeier
        /// </summary>
        /// <param name="button"></param>
        public void pbSave_Click(Button button)
        {
            TabControl tC = this.parentTabControl;

            pNewClientPerson       pPerson       = getPageFromTabs <pNewClientPerson>();
            pNewClientPartnerChild pPartnerChild = getPageFromTabs <pNewClientPartnerChild>();
            pNewClientRevenues     pRevenues     = getPageFromTabs <pNewClientRevenues>();

            bool _PersonIsValid       = pPerson.checkPersonTab(),
                 _ChildPartnerIsValid = pPartnerChild.checkPartnerChildTab(),
                 _RevenuesIsValid     = pRevenues.checkRevenuesTab();

            if (_PersonIsValid == false)
            {
                pPerson.getErrorMsg();
            }
            pPerson.clearErrorMsg();

            if (((TabItem)tC.Items.GetItemAt(1)).IsEnabled)
            {
                if (_PersonIsValid && _ChildPartnerIsValid == false)
                {
                    pPartnerChild.getErrorMsg();
                }
            }
            pPartnerChild.clearErrorMsg();

            if (((TabItem)tC.Items.GetItemAt(2)).IsEnabled)
            {
                if (_PersonIsValid && _ChildPartnerIsValid && _RevenuesIsValid == false)
                {
                    pRevenues.getErrorMsg();
                }
            }
            pRevenues.clearErrorMsg();

            if (_PersonIsValid && _ChildPartnerIsValid && _RevenuesIsValid)
            {
                try
                {
                    // Daten für Person holen
                    DB.Title       title = pPerson.cbTitle.SelectedItem as DB.Title;
                    DB.FamilyState fS    = pPerson.cbFamilyState.SelectedItem as DB.FamilyState;

                    String   firstName     = pPerson.txtFirstName.Text;
                    String   lastName      = pPerson.txtLastName.Text;
                    String   street        = pPerson.txtStreet.Text;
                    String   nationality   = pPerson.txtNationalCountry.Text;
                    DateTime birthday      = (DateTime)pPerson.dpBirthday.SelectedDate;
                    int      group         = Convert.ToInt32(pPerson.cbGroup.SelectedValue.ToString());
                    int      zipCode       = Convert.ToInt32(pPerson.txtZipCode.Text);
                    String   city          = pPerson.txtCity.Text;
                    DateTime startDate     = (DateTime)pPerson.dpStartDate.SelectedDate;
                    DateTime endDate       = (DateTime)pPerson.dpEndDate.SelectedDate;
                    int      childs        = Convert.ToInt32(pPerson.txtChildrens.Content);
                    String   nativeCountry = pPerson.txtNativeCountry.Text;
                    String   email         = pPerson.txtEmail.Text;
                    String   mobileNo      = pPerson.txtMobileNo.Text;
                    String   phoneNo       = pPerson.txtTelno.Text;
                    int      tableNo       = Convert.ToInt32(pPerson.txtTableNo.Text);
                    // Daten für Partner holen

                    String   firstNamePartner     = pPartnerChild.txtFirstName1.Text;
                    String   lastNamePartner      = pPartnerChild.txtLastName1.Text;
                    String   nationalityPartner   = pPartnerChild.txtNationalCountry1.Text;
                    DateTime?birthdayPartner      = pPartnerChild.dpBirthday1.SelectedDate;
                    String   nativeCountryPartner = pPartnerChild.txtNativeCountry1.Text;
                    String   maritalPhone         = pPartnerChild.txtTelno1.Text;
                    String   maritalMobile        = pPartnerChild.txtMobileNo1.Text;
                    String   maritalEmail         = pPartnerChild.txtEmail1.Text;

                    DB.Title maritalTitle   = pPartnerChild.cbTitle1.SelectedItem as DB.Title;
                    int      maritalTitleID = maritalTitle.TitleID;

                    //UserID beschreiben
                    int userID = _UserAccount.UserAccountID;

                    // Person speichern
                    var personID = DB.Person.Add(title.TitleID, fS.FamilyStateID, firstName, lastName, street, nationality, birthday, group, zipCode, city, startDate, endDate,
                                                 userID, nativeCountry, email, mobileNo, phoneNo, firstNamePartner, lastNamePartner, nationalityPartner, birthdayPartner, nativeCountryPartner, maritalPhone, maritalMobile, maritalEmail, maritalTitle.TitleID, null, tableNo);

                    // Alle Kinder holen und speichern
                    IList <DB.Child> lChilds = new List <DB.Child>();
                    lChilds = pPartnerChild.getChilds();

                    foreach (DB.Child aChild in lChilds)
                    {
                        String   aChildLastName  = aChild.LastName;
                        String   aChildFirstName = aChild.FirstName;
                        bool     aChildIsFemale  = aChild.IsFemale;
                        DateTime aChildsBirthday = aChild.DateOfBirth;

                        var childID = DB.Child.Add(personID, aChildFirstName, aChildLastName, aChildsBirthday, aChildIsFemale);
                    }

                    // Alle Revenues holen und speichern
                    IList <DB.Revenue> lRevs = new List <DB.Revenue>();
                    lRevs = pRevenues.getRevenues();

                    foreach (DB.Revenue aRev in lRevs)
                    {
                        Double amount   = aRev.Amount;
                        String desc     = aRev.Description;
                        int    revTypID = aRev.RevenueType.RevenueTypeID;


                        var revenueID = DB.Revenue.Add(personID, revTypID, amount, aRev.StartDate, aRev.EndDate, desc);
                    }

                    //Wenn erfolgreich Dokumente Drucken
                    MessageBoxResult result1 = MessageBoxEnhanced.Question("Möchten Sie für diesen neuen Kunden das Aufnahmeformular jetzt drucken?");
                    if (result1 == MessageBoxResult.Yes)
                    {
                        PrintForms.printClientEnrolmentForm(personID);
                    }

                    MessageBoxResult result2 = MessageBoxEnhanced.Question("Möchten Sie für diesen neuen Kunden die Widerrufbelehrung jetzt drucken?");
                    if (result2 == MessageBoxResult.Yes)
                    {
                        PrintForms.printClientDisclaimer(personID);
                    }

                    //Zurück zur Verwaltung
                    KPage      pageClientAdministration = new KöTaf.WPFApplication.Views.pClientAdministration();
                    SinglePage singlePage = new SinglePage(IniParser.GetSetting("CLIENT", "clientManagement"), pageClientAdministration);
                }
                catch
                {
                    MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "common"));
                }
            }
        }