/// <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> /// Ändert den Status des Teammitgliedes /// Author: Antonios Fesenmeier, Florian Wasilewski, Georg Schmid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pbIsActive_Click(object sender, RoutedEventArgs e) { //Setzt den Rücksprungwert für das Paging pagingStartValue = _DataGridPaging.getStartOfDataGridItems(); var currentSelectedPerson = dGTeamView.SelectedItem as Team; if (currentSelectedPerson != null) { var personId = currentSelectedPerson.TeamID; var state = currentSelectedPerson.IsActive; var message = string.Format(IniParser.GetSetting("TEAM", "confirmationFormatString"), currentSelectedPerson.LastName + " " + currentSelectedPerson.FirstName, ((state) ? IniParser.GetSetting("FILTER", "inactive") : IniParser.GetSetting("FILTER", "active"))); var dialogResult = MessageBox.Show(message, IniParser.GetSetting("TEAM", "confirmationNeeded"), MessageBoxButton.OKCancel, MessageBoxImage.Question); if (dialogResult == MessageBoxResult.OK) { if (state) { Team.Deactivate(personId); } else { Team.Activate(personId); } //Veränderte Daten auf variable Schreiben _Teams = Team.GetTeams(); if (this.parentToolbar.searchPanel.searchBox.Text == IniParser.GetSetting("APPSETTINGS", "search")) { processKeyUp(""); } else { processKeyUp(this.parentToolbar.searchPanel.searchBox.Text); } _DataGridPaging.setStartOfDataGridItems(pagingStartValue); FillTeamDataGrid(_DataGridPaging.ActualSide()); } } }