private async void addNewQualiti_Click(object sender, RoutedEventArgs e) { if (qualitieDropDown.SelectedItem == null) { MessageBox.Show("Ingen kompetens är vald!"); } else { MyQualites.Add(UnCheckedQualites[qualitieDropDown.SelectedIndex]); await ManageMechanics.ChangeMechanic(Mechanic.IdNumber.ToString(), MyQualites, ManageMechanics.AllMechanics()); UpDatePage(); } }
private async void deleteButton_Click(object sender, RoutedEventArgs e) { if (qualitiesListBox.SelectedItem == null) { MessageBox.Show("Ingen kompetens är vald!"); } else { MyQualites.RemoveAt(qualitiesListBox.SelectedIndex); ManageMechanics = new ManageMechanics(); await ManageMechanics.ChangeMechanic(Mechanic.IdNumber.ToString(), MyQualites, ManageMechanics.AllMechanics()); UpDatePage(); } }
private async void changeButton_Click(object sender, RoutedEventArgs e) { List <Component> qualifications = new List <Component>(); if (this.brakesCheckBox.IsChecked == true) { qualifications.Add(Component.Bromsar); } if (this.engineCheckBox.IsChecked == true) { qualifications.Add(Component.Motor); } if (this.carrieageBodyCheckBox.IsChecked == true) { qualifications.Add(Component.Kaross); } if (this.tiresCheckBox.IsChecked == true) { qualifications.Add(Component.Däck); } if (this.windShieldCheckBox.IsChecked == true) { qualifications.Add(Component.Vindrutor); } ManageMechanics manageMechanics = new ManageMechanics(); await manageMechanics.ChangeMechanic(Mechanic.IdNumber.ToString(), qualifications, Mechanics); ManageMechanicsPage manageMechanicsPage = new ManageMechanicsPage(); this.NavigationService.Navigate(manageMechanicsPage); }