diff --git a/MainWindow.axaml b/MainWindow.axaml index 9d11cd7..16af180 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -154,7 +154,7 @@ - diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs index b23cb23..ee3530d 100644 --- a/MainWindow.axaml.cs +++ b/MainWindow.axaml.cs @@ -135,6 +135,26 @@ public partial class MainWindow : Window //await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig"); } + private async void StartAddressRepairer(KasAddressList set) + { + //var addresses = DataImport.ImportKasAddressList(path); // Ihr Code hier + + var progressWindow = new ProgressWindow(); + + progressWindow.Show(_instance); + + var processor = new AddressRepair(progressWindow); + await processor.Perform(set); + + // foreach (var item in result) + // { + // } + + progressWindow.Close(); + Settings.Save(); + //await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig"); + } + private void MnuExit_OnClick(object? sender, RoutedEventArgs e) { @@ -704,7 +724,7 @@ public partial class MainWindow : Window if (pers.PersonError != null) { BtnShorten.IsEnabled = true; - // BtnRepair.IsEnabled = true; + BtnRepair.IsEnabled = true; break; } else @@ -1346,4 +1366,16 @@ public partial class MainWindow : Window { PopulateNavTree(); } + + private void BtnRepair_OnClick(object? sender, RoutedEventArgs e) + { + MakeCalcManVisible(); + if (LstCustomerAdressSets.SelectedIndex == -1) + { + MessageBox.Show(null, "Bitte zunächst ein Adress-Set auswählen", "Kein Adress-Set ausgewählt"); + return; + } + + StartAddressRepairer((KasAddressList)LstCustomerAdressSets.SelectedItem); + } }