/// <summary> /// Bestätigung Druck /// Generiert Daten und öffnet LibreOFfice /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConfirm_Click(object sender, RoutedEventArgs e) { FormletterPattern frmltrPattern = FormletterPattern.GetFormletterPatterns(formletterPatternID).ToList().FirstOrDefault(); FormletterFilterData formletterFilterData = new FormletterFilterData(formletterPatternID); bool success = formletterFilterData.fillCsvFile(); if (success) { LibreOffice.openWithWriter(frmltrPattern.FileName, false, false); } // Generiere wieder die Druckseite KPage formletterPrint = new pFormletterPrint(); SinglePage formletter = new SinglePage(IniParser.GetSetting("FORMLETTER", "formletterPrint"), formletterPrint); }
/// <summary> /// Löscht den ausgewählten Serienbrief /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void buttonDelete_Click(object sender, RoutedEventArgs e) { try { var item = (sender as FrameworkElement).DataContext; int index = listView.Items.IndexOf(item); List<FormletterPatternItem> formletterPatternItems = (List<FormletterPatternItem>)DataContext; FormletterPatternItem toDelete = formletterPatternItems[index]; int pID = toDelete.formletterPatternId; KPage pageDelete = new pFormletterDelete(pID); SinglePage singlePage = new SinglePage(IniParser.GetSetting("FORMLETTER","formletterDelete"), pageDelete); } catch { } }
/// <summary> /// Löscht den ausgewählten Serienbrief /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void buttonPrint_Click(object sender, RoutedEventArgs e) { if (!LibreOffice.isLibreOfficeInstalled()) { string warning = IniParser.GetSetting("ERRORMSG", "libre"); MessageBoxEnhanced.Error(warning); } try { var item = (sender as FrameworkElement).DataContext; int index = listView.Items.IndexOf(item); List<FormletterPatternItem> formletterPatternItems = (List<FormletterPatternItem>)DataContext; FormletterPatternItem toPrint = formletterPatternItems[index]; int pID = toPrint.formletterPatternId; KPage pagePrint = new pFormletterPrintDetail(pID); SinglePage singlePage = new SinglePage(IniParser.GetSetting("FORMLETTER", "formletterPatternPrint"), pagePrint); } catch { } }
/// <summary> /// Button zum Abbruch /// </summary> /// <param name="button"></param> private void pbBack_Click(Button button) { KPage pageSponsorAdministration = new KöTaf.WPFApplication.Views.pSponsorAdministration(pagingStartValue); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "sponsorAdministration"), pageSponsorAdministration); }
/// <summary> /// Nach dem Editieren wird auf Korrektheit geprüft und ggfs. in die DB gespeichert /// Author: Antonios Fesenmeier /// </summary> /// <param name="button"></param> private void pbSave_Click(Button button) { _Validator.clearSB(); // Wurde die Validierung positiv abgeschlossen müssen die Werte der einzelnen Felder in die Datenbank geschrieben werden! CheckForm(); var isCompany = chBIsCompany.IsChecked; if (_IsValid == false) MessageBoxEnhanced.Error(_Validator.getErrorMsg().ToString()); else { var title = cbTitle.SelectedItem as DB.Title; var fundingType = cBFundType.SelectedItem as DB.FundingType; if (isCompany == true) { DB.Sponsor.Update(_CurrentSponsor.SponsorID, title.TitleID, fundingType.FundingTypeID, txtStreet.Text, txtCity.Text, Convert.ToInt32(txtZipCode.Text), txtFirstName.Text, txtLastName.Text, txtCompanyName.Text, txtMobileNo.Text, txtTelNo.Text, txtFax.Text, txtEMail.Text, null, isCompany.Value); } else { DB.Sponsor.Update(_CurrentSponsor.SponsorID, title.TitleID, fundingType.FundingTypeID, txtStreet.Text, txtCity.Text, Convert.ToInt32(txtZipCode.Text), txtFirstName.Text, txtLastName.Text, "", txtMobileNo.Text, txtTelNo.Text, txtFax.Text, txtEMail.Text, null, isCompany.Value); } KPage pageSponsorAdministration = new KöTaf.WPFApplication.Views.pSponsorAdministration(pagingStartValue); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "sponsorAdministration"), pageSponsorAdministration); } _Validator.clearSB(); }
/// <summary> /// Speichern Button Klick Event /// </summary> /// <param name="button"></param> private void SaveButton_Click(Button button) { if (ValidateUserInput()) { var name = NameTextBox.Text; var description = SafeStringParser.safeParseToStr(DescriptionTextBox.Text); var noteId = Note.Add(name, description); if (noteId > 0) { KPage pageNoteAdmin = new KöTaf.WPFApplication.Views.pNoteAdministration(); ; SinglePage singlePage = new SinglePage(IniParser.GetSetting("NOTES", "notes"), pageNoteAdmin); } } }
private void pbEdit_Click(object sender, RoutedEventArgs e) { //Setzt den Rücksprungwert für das Paging pagingStartValue = _DataGridPaging.getStartOfDataGridItems(); Sponsor sponsor = this.dGSponsorView.SelectedItem as Sponsor; if (sponsor != null) { KPage pageEditSponsor = new KöTaf.WPFApplication.Views.pEditSponsor(sponsor, pagingStartValue); SinglePage singlePage = new SinglePage("Sponsor bearbeiten", pageEditSponsor); } else MessageBoxEnhanced.Error("Es ist ein Fehler beim Laden des aktuellen Sponsors aufgetreten"); }
/// <summary> /// Druck /// </summary> private void pbPrint_Click(object sender, RoutedEventArgs e) { KPage printPage = new Print(); SinglePage print = new SinglePage(IniParser.GetSetting("APPSETTINGS", "print"), printPage); }
/// <summary> /// Überprüft alle Felder auf Korrektheit, anschließend entweder Fehlerausgabe oder speichern der Daten /// Author: Antonios Fesenmeier /// </summary> /// <param name="button"></param> private void pbSave_Click(Button button) { _Validator.clearSB(); // Wurde die Validierung positiv abgeschlossen müssen die Werte der einzelnen Felder in die Datenbank geschrieben werden! CheckForm(); if (_IsValid == false) { MessageBox.Show(_Validator.getErrorMsg().ToString(), IniParser.GetSetting("ERRORMSG", "noTextField"), MessageBoxButton.OK, MessageBoxImage.Hand); } else { try { var title = cbTitle.SelectedItem as DataModel.Title; var teamFunction = cBFunction.SelectedItem as TeamFunction; var firstName = txtFirstName.Text; var lastName = txtLastName.Text; var street = txtStreet.Text; var zipCode = int.Parse(txtZipCode.Text); var city = txtCity.Text; var dateOfBirth = (DateTime)dpBirthday.SelectedDate; var mobileNo = txtMobileNo1.Text; var phoneNo = txtTelNo1.Text; var email = txtEMail1.Text; var isFormLetterAllowed = (bool)chBIsFormletterAllowed.IsChecked; var teamId = Team.Add(title.TitleID, teamFunction.TeamFunctionID, firstName, lastName, street, zipCode, city, dateOfBirth, mobileNo, phoneNo, email, isFormLetterAllowed); if (teamId > 0) { KPage pageTeamAdministration = new KöTaf.WPFApplication.Views.pTeamAdministration(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "teamAdministration"), pageTeamAdministration); } else MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "saveDataRecord")); } catch { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "common")); } } _Validator.clearSB(); }
/// <summary> /// Button-Klick-Funktion für "Serienbrief-Vorlage speichern"-Button /// </summary> /// <param name="senderButton">die Instanz des sendenden Buttons</param> private void saveFormletterTemplate(Button senderButton) { try { // When using tabs, you can retrieve a page instance included in a tab using this function, giving the page type pFormletterFilterSelection pageFilter = getPageFromTabs<pFormletterFilterSelection>(); pFormletterFileLinking pageFile = getPageFromTabs<pFormletterFileLinking>(); pFormletterTextFields pageText = getPageFromTabs<pFormletterTextFields>(); // Prüfe ob alle Eingaben richtig sind if (pageFilter.allFilterSets.Count == 0) { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "noFilterSet")); pageFilter.parentTabControl.SelectedIndex = 0; return; } if (pageFile.lbFileName.Content.Equals("")) { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "noFormletter")); pageFile.parentTabControl.SelectedIndex = 1; return; } if (!pageFile.validateLinkings()) { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "noAssignment")); pageFile.parentTabControl.SelectedIndex = 1; return; } if (!pageText.validateTextFields()) { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "noTextField")); pageText.parentTabControl.SelectedIndex = 2; return; } // Hole alle Filter-Sets List<FilterSetModel> filterSets = pageFilter.allFilterSets; // Neues FormletterPatternModelDB (Serienbriefvorlage) anlegen string pName = pageText.tbPatternName.Text; string saluationM = pageText.tbSaluationM.Text; string saluationF = pageText.tbSaluationF.Text; string saluationN = pageText.tbSaluationN.Text; string filename = pageFile.tbFileName.Text.Replace(System.IO.Directory.GetCurrentDirectory(), "%PROGRAMPATH%"); string text = ""; int frmltrPatternID = FormletterPattern.Add(pName, saluationM, saluationF, saluationN, filename, text); // Bearbeite alle FilterSets foreach (var set in filterSets) { string name = ""; // Für Filter-Sets leer, nur von Listen/Statistiken verwendet string linking = set.linkingType; int filterSetID = FilterSet.Add(name, linking, frmltrPatternID); // Bearbeite alle Filter zu jedem Set foreach (var filter in set.filterList) { string table = filter.group.ToString(); string type = filter.criterion.ToString(); string operation = filter.operation.ToString(); string value = filter.value; int filterID = Filter.Add(filterSetID, table, type, operation, value); } } // Hole alle Spaltenzuordnungen List<FormletterColumnCsvDocumentAssignment> list = pageFile.getAssignments(); // Schreibe Spaltenzuordnungen in die Datenbank foreach (var assignment in list) { string csvColumn = assignment.csv_col_name; string databaseTable = assignment.formletterTableAssignment.group.ToString(); string databaseColumn = assignment.formletterTableAssignment.field.ToString(); ColumnAssignment.Add(frmltrPatternID, csvColumn, databaseTable, databaseColumn); } //Leere Formular pageFilter.resetEverything(); pageFile.resetEverything(); pageText.resetEverything(); KPage pageFormletterAdmin = new KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("FORMLETTER", "formletterAdmin"), pageFormletterAdmin); } catch { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "formletterCreate")); } }
/// <summary> /// Speichert bei Korrektheit aller Tabs die veränderten Kunden, Kinder, Partner und Einkommensdaten /// /// Author: Antonios Fesenmeier, Georg Schmid /// </summary> /// <param name="button"></param> public void pbSaveEdit_Click(Button button) { TabControl tC = this.parentTabControl; pEditClientPerson pPerson = getPageFromTabs<pEditClientPerson>(); pEditClientPartnerChild pPartnerChild = getPageFromTabs<pEditClientPartnerChild>(); pEditClientRevenues pRevenues = getPageFromTabs<pEditClientRevenues>(); 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; //TeamID mit UserID beschreiben int userID = _UserAccount.UserAccountID; //Person aktualisieren int personID = pPerson.getPersonID(); if (maritalTitle != null) DB.Person.Update(personID, title.TitleID, fS.FamilyStateID, userID, firstName, lastName, zipCode, city, street, nationality, tableNo, phoneNo, mobileNo, null, nativeCountry, birthday, email, group, startDate, endDate, birthdayPartner, firstNamePartner, lastNamePartner, nationalityPartner, null, nativeCountryPartner, maritalPhone, maritalMobile, maritalEmail, maritalTitle.TitleID); else DB.Person.Update(personID, title.TitleID, fS.FamilyStateID, userID, firstName, lastName, zipCode, city, street, nationality, tableNo, phoneNo, mobileNo, null, nativeCountry, birthday, email, group, startDate, endDate, birthdayPartner, firstNamePartner, lastNamePartner, nationalityPartner, null, nativeCountryPartner, maritalPhone, maritalMobile, maritalEmail); // 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; if (aChild.ChildID == 0) { var childID = DB.Child.Add(personID, aChildFirstName, aChildLastName, aChildsBirthday, aChildIsFemale); } else { DB.Child.Update(aChild.ChildID, 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; if (aRev.RevenueID == 0) { var revenueID = DB.Revenue.Add(personID, revTypID, amount, aRev.StartDate, aRev.EndDate, desc); } else { DB.Revenue.Update(aRev.RevenueID, revTypID, amount, desc, aRev.StartDate, aRev.EndDate); } } //Gelöschte Childs aus Datenbank entfernen List<int> deletedChilds = pPartnerChild.getDeletedChilds(); foreach (int dchildID in deletedChilds) { if (dchildID != 0) DB.Child.Delete(dchildID); } //Gelöschte Revenues aus Datenbank entfernen List<int> deletedRevenues = pRevenues.getDeletedRevenues(); foreach (int drevID in deletedRevenues) { if(drevID != 0) DB.Revenue.Delete(drevID); } //Zurück zur Verwaltung KPage pageClientAdministration = new KöTaf.WPFApplication.Views.pClientAdministration(pagingStartValue); SinglePage singlePage = new SinglePage(IniParser.GetSetting("CLIENT", "clientManagement"), pageClientAdministration); } catch { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "common")); } } }
public Examples() { int x = 1; // Untermenü, nur Frame if (x == 1) { SubnavigationPage mySubnavigation = new SubnavigationPage("Seitentitel 123"); Type pageType1 = typeof(KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration); mySubnavigation.addSubnavigation("subpage1", pageType1); Type pageType2 = typeof(KöTaf.WPFApplication.Views.pWelcomeScreen); mySubnavigation.addSubnavigation("subpage2", pageType2); } // Untermenü mit Tabs und jeweils einem Frame // Jeder Frame hat eine Toolbar mit Buttons und SuchBox if (x == 2) { SubnavigationPage mySubnavigation = new SubnavigationPage("Seitentitel 234"); List<SimpleTabItem> myTabList = new List<SimpleTabItem>(); KPage p1 = new KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration(); KPage p2 = new KöTaf.WPFApplication.Views.pWelcomeScreen(); SimpleTabItem simpleTabItem1 = new SimpleTabItem("tab1", p1); SimpleTabItem simpleTabItem2 = new SimpleTabItem("tab2", p2); myTabList.Add(simpleTabItem1); myTabList.Add(simpleTabItem2); simpleTabItem1.toolbar.addButton("Button1", myButtonFunction); simpleTabItem1.toolbar.addButton("Button2", myButtonFunction); simpleTabItem1.toolbar.addSearchPanel(mySearchFunction); simpleTabItem2.toolbar.addButton("Button3", myButtonFunction); simpleTabItem2.toolbar.addButton("Button4", myButtonFunction); simpleTabItem2.toolbar.addSearchPanel(mySearchFunction); mySubnavigation.addSubnavigation("sometabs", myTabList); } // Einfache Seite mit einem Frame if (x == 3) { KPage pageFormletterAdmin = new KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration(); SinglePage singlePage = new SinglePage("Formletter Admin", pageFormletterAdmin); } // Einfache Seite mit Tabs mit jeweils einem Frame if (x == 4) { List<SimpleTabItem> myTabList = new List<SimpleTabItem>(); KPage p1 = new KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration(); myTabList.Add(new SimpleTabItem("tab1", p1)); KPage p2 = new KöTaf.WPFApplication.Views.pWelcomeScreen(); myTabList.Add(new SimpleTabItem("tab2", p2)); SinglePage singlePage = new SinglePage(this, "Formletter Admin", myTabList); } }
/// <summary> /// Notiz bearbeiten Klick Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditNoteButton_Click(object sender, RoutedEventArgs e) { Note currentSelectedNote = NotesDatagrid.SelectedItem as Note; if (currentSelectedNote != null) { KPage pageNoteAdmin = new KöTaf.WPFApplication.Views.pEditNote(currentSelectedNote); ; SinglePage singlePage = new SinglePage(IniParser.GetSetting("NOTES", "notes"), pageNoteAdmin); } else MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "loadNote")); }
/// <summary> /// Seite initialisieren /// </summary> public void initPage() { KPage welcomeScr = new KöTaf.WPFApplication.Views.pWelcomeScreen(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "welcome"), welcomeScr); }
/// <summary> /// Team /// </summary> private void pbTeamAdministration_Click(object sender, RoutedEventArgs e) { KPage pageTeamAdministration = new KöTaf.WPFApplication.Views.pTeamAdministration(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "teamAdministration"), pageTeamAdministration); }
/// <summary> /// Statistiken /// </summary> private void pbStatistic_Click(object sender, RoutedEventArgs e) { // Load the generalStatistic page // Simple Page // The toolbar must be built in the pGeneralStatistic.cs file itself Cursor = Cursors.Wait; KPage pageStatistic = new KöTaf.WPFApplication.Views.Statistic.pGeneralStatistic(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "statistic"), pageStatistic); Cursor = Cursors.Arrow; }
private void pbNewSponsor_Click(Button button) { KPage pageNewSponsor = new KöTaf.WPFApplication.Views.pNewSponsor(); SinglePage singlePage = new SinglePage("Neuen Sponsor anlegen", pageNewSponsor); }
/// <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> /// Abbrechen der Kundenanlage, navigiert zurück zur Startseite der Kundenverwaltung /// /// Author: Antonios Fesenmeier /// </summary> /// <param name="button"></param> public void pbAbort_Click(Button button) { KPage pageClientAdministration = new KöTaf.WPFApplication.Views.pClientAdministration(pagingStartValue); SinglePage singlePage = new SinglePage(IniParser.GetSetting("CLIENT", "clientManagement"), pageClientAdministration); }
/// <summary> /// Speichern-Button /// </summary> /// <param name="button"></param> private void pbSave_Click(Button button) { _Validator.clearSB(); CheckForm(); if (_IsValid == false) { MessageBox.Show(_Validator.getErrorMsg().ToString(), IniParser.GetSetting("ERRORMSG", "noTextField"), MessageBoxButton.OK, MessageBoxImage.Hand); } else { try { var teamId = this._CurrentTeamMember.TeamID; var teamTitle = cbTitle.SelectedItem as DataModel.Title; var teamFunction = cBFunction.SelectedItem as TeamFunction; var dateOfBirth = (DateTime)dpBirthday.SelectedDate; var firstName = txtFirstName.Text; var lastName = txtLastName.Text; var street = txtStreet.Text; var zipCode = int.Parse(txtZipCode.Text); var city = txtCity.Text; var mobileNo = txtMobileNo1.Text; var phoneNo = txtTelNo1.Text; var email = txtEMail1.Text; var isFormletterAllowed = (bool)chBIsFormletterAllowed.IsChecked; Team.Update(teamId, dateOfBirth, teamTitle.TitleID, teamFunction.TeamFunctionID, firstName, lastName, street, zipCode, city, mobileNo, phoneNo, email, isFormletterAllowed); if (cbIsActive.IsChecked == true) Team.Activate(teamId); else Team.Deactivate(teamId); KPage pageTeamAdministration = new KöTaf.WPFApplication.Views.pTeamAdministration(pagingStartValue); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "teamAdministration"), pageTeamAdministration); } catch { MessageBoxEnhanced.Error(IniParser.GetSetting("ERRORMSG", "common")); } } _Validator.clearSB(); }
/// <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")); } } }
/// <summary> /// Notizen /// </summary> private void pbNotes_Click(object sender, RoutedEventArgs e) { KPage pageNoteAdmin = new KöTaf.WPFApplication.Views.pNoteAdministration(); ; SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "notes"), pageNoteAdmin); }
/// <summary> /// Button zum hinzufügen eines neuen Kunden, laden der jeweiligen Tabseiten und festlegen des ToolbarContents /// /// Author: Antonios Fesenmeier /// </summary> /// <param name="Button"></param> private void pbNewClient_Click(Button Button) { /* var keyValueList = ClientDataGrid.ToKeyValueList(); KöTaf.Utils.Printer.CSVExporter csv = new Utils.Printer.CSVExporter(keyValueList); var header = csv.GetHeader(); var content = csv.GetData(); var csvFull = csv.GetCsv(); csv.Write(); */ // Adding a new tab with the according page shown under this tab KPage person = new KöTaf.WPFApplication.Views.Client.pNewClientPerson(); SimpleTabItem tabPerson = new SimpleTabItem(IniParser.GetSetting("CLIENT", "personalData"), person); this._myTabList.Add(tabPerson); KPage partnerChild = new KöTaf.WPFApplication.Views.Client.pNewClientPartnerChild(); SimpleTabItem tabPartnerChild = new SimpleTabItem(IniParser.GetSetting("CLIENT", "partnerAndChildren"), partnerChild); this._myTabList.Add(tabPartnerChild); KPage revenues = new KöTaf.WPFApplication.Views.Client.pNewClientRevenues(); SimpleTabItem tabRevenues = new SimpleTabItem(IniParser.GetSetting("CLIENT", "revenue"), revenues); this._myTabList.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"), pbNext_Click); tabPerson.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSave_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"), pbNext_Click); tabPartnerChild.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSave_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"), pbNext_Click); tabRevenues.toolbar.addButton(IniParser.GetSetting("BUTTONS", "save"), pbSave_Click); SinglePage singlePage = new SinglePage(this, IniParser.GetSetting("CLIENT", "createNewClient"), this._myTabList); }
/// <summary> /// Das Erstellen einer neuen SB-Vorlage abbrechen /// </summary> /// <param name="btn">sendender Button</param> private void cancelFormletterTemplate(Button btn) { KPage pageFormletterAdmin = new KöTaf.WPFApplication.Views.Formletter.pFormletterAdministration(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("FORMLETTER", "formletterAdmin"), pageFormletterAdmin); }
/// Dient als Abbruch, weiterleitung an Übersicht /// Author: Antonios Fesenmeier private void pbBack_Click(Button button) { KPage pageTeamAdministration = new KöTaf.WPFApplication.Views.pTeamAdministration(); SinglePage singlePage = new SinglePage(IniParser.GetSetting("APPSETTINGS", "teamAdministration"), pageTeamAdministration); }
/// <summary> /// Serienbrief-Vorlage speichern /// </summary> /// <param name="button"></param> private void createFormletter_Click(Button button) { // Liste aller anzuzeigenden Tabs List<SimpleTabItem> myTabList = new List<SimpleTabItem>(); // Füge einen neuen Tab mit der zugehörigen Seite hinzu, die darin angezeigt werden soll KPage filter = new pFormletterFilterSelection(); SimpleTabItem tabFilter = new SimpleTabItem(IniParser.GetSetting("FORMLETTER", "formletterReceiver"), filter); myTabList.Add(tabFilter); // Füge einen neuen Tab mit der zugehörigen Seite hinzu, die darin angezeigt werden soll KPage text = new pFormletterTextFields(); SimpleTabItem tabText = new SimpleTabItem(IniParser.GetSetting("FORMLETTER", "formletterTextFields"), text); myTabList.Add(tabText); // Füge einen neuen Tab mit der zugehörigen Seite hinzu, die darin angezeigt werden soll KPage file = new pFormletterFileLinking(); SimpleTabItem tabFile = new SimpleTabItem(IniParser.GetSetting("FORMLETTER", "formletterLinking"), file); myTabList.Add(tabFile); // Füge drei Buttons hinzu, damit der Speichern-Button unter jedem Tab gleich ist tabFilter.toolbar.addButton(IniParser.GetSetting("FORMLETTER", "formletterSave"), saveFormletterTemplate); tabFile.toolbar.addButton(IniParser.GetSetting("FORMLETTER", "formletterSave"), saveFormletterTemplate); tabText.toolbar.addButton(IniParser.GetSetting("FORMLETTER", "formletterSave"), saveFormletterTemplate); tabFilter.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), cancelFormletterTemplate); tabFile.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), cancelFormletterTemplate); tabText.toolbar.addButton(IniParser.GetSetting("BUTTONS", "cancel"), cancelFormletterTemplate); // Zeige die Tabs in einer SinglePage an SinglePage singlePage = new SinglePage(this, IniParser.GetSetting("FORMLETTER", "formletterNew"), myTabList); }
/// <summary> /// Zurück Button Klick Event /// </summary> /// <param name="button"></param> private void BackButton_Click(Button button) { KPage pageNoteAdmin = new KöTaf.WPFApplication.Views.pNoteAdministration(); ; SinglePage singlePage = new SinglePage(IniParser.GetSetting("NOTES", "notes"), pageNoteAdmin); }
/// <summary> /// Serienbrief-Druck öffnen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btFormletter_Click(object sender, RoutedEventArgs e) { KPage formletterPrint = new pFormletterPrint(); SinglePage formletter = new SinglePage(IniParser.GetSetting("FORMLETTER", "formLetterPrint"), formletterPrint); }
private void Init() { //Setup GUI List<SimpleTabItem> myTabList = new List<SimpleTabItem>(); KPage p1 = new KöTaf.WPFApplication.Views.Statistic.pGeneralStatistic(); myTabList.Add(new SimpleTabItem("Beliebige Statistik", p1)); SinglePage singlePage = new SinglePage(this, "Statistiken", myTabList); GenerateGeneralStatistics(); fillSavedFilter(); //Grant access to FilterSets for admins //if ((this._UserAccount != null) && (this._UserAccount.IsAdmin)) // frame_filter.Content = new Views.Formletter.pFormletterFilterSelection(); //else //{ // frame_filter.Content = new Label // { // Content = "Sie müssen als Administrator eingeloggt sein, um Filter-Sets erstellen zu können!" // }; // bDeleteSavedFilter.Visibility = Visibility.Hidden; //} //Save Displayed-Data-Combo-Boxes in an array displayedDataComboBoxes.Add(cbDisplayedData1); displayedDataComboBoxes.Add(cbDisplayedData2); displayedDataComboBoxes.Add(cbDisplayedData3); displayedDataComboBoxes.Add(cbDisplayedData4); displayedDataComboBoxes.Add(cbDisplayedData5); }
/// <summary> /// Nach Validierung der einzelnen Felder wird der Sponsor in der DB abgelegt /// Author: Anotnios Fesenmeier /// </summary> /// <param name="button"></param> private void pbSave_Click(Button button) { // bool formLetter = false; _Validator.clearSB(); // Wurde die Validierung positiv abgeschlossen müssen die Werte der einzelnen Felder in die Datenbank geschrieben werden! CheckForm(); if (!this._IsValid) MessageBoxEnhanced.Error(_Validator.getErrorMsg().ToString()); else { var fundingType = cBFundingTyp.SelectedItem as FundingType; var title = cbTitle.SelectedItem as Title; var isFormLetterAllowed = chBformLetter.IsChecked; var isCompany = chBIsCompany.IsChecked; int _sponsorID; if (isCompany == true) { _sponsorID = Sponsor.Add(fundingType.FundingTypeID, title.TitleID, txtFirstName.Text, txtLastName.Text, txtCity.Text, txtStreet.Text, Convert.ToInt32(txtZipCode.Text), isFormLetterAllowed.Value, txtCompanyName.Text, null, txtEMail.Text, txtFax.Text, txtMobileNo.Text, txtTelNo.Text, isCompany.Value); } else { _sponsorID= Sponsor.Add(fundingType.FundingTypeID, title.TitleID, txtFirstName.Text, txtLastName.Text, txtCity.Text, txtStreet.Text, Convert.ToInt32(txtZipCode.Text), isFormLetterAllowed.Value, txtCompanyName.Text, null, txtEMail.Text, txtFax.Text, txtMobileNo.Text, txtTelNo.Text, isCompany.Value); } if (_sponsorID > 0) { KPage pageSponsorAdministration = new KöTaf.WPFApplication.Views.pSponsorAdministration(); SinglePage singlePage = new SinglePage("Sponsorverwaltung", pageSponsorAdministration); } else MessageBoxEnhanced.Error("Es ist ein Fehler beim speichern des Datensatzes aufgetreten"); } _Validator.clearSB(); }