diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs index 75e005c..0f586e1 100644 --- a/MainWindow.axaml.cs +++ b/MainWindow.axaml.cs @@ -887,4 +887,31 @@ public partial class MainWindow : Window MessageBox.Show(this, ex.StackTrace, "Fehler"); } } + + private async void MnIAdSetRename_OnClick(object? sender, RoutedEventArgs e) + { + if (LstCustomerAdressSets.SelectedItems.Count > 0) + try + { + var result = await NamingWindow.Show(this); + if (result != null) + { + var id = KasAddressList.GetIDByAddressSetListItem(LstCustomerAdressSets.SelectedItems[0] + .ToString()); + var cus_id = Customer.GetIDByCustomerListItem(LstCustomers.SelectedItems[0].ToString()); + foreach (var set in Settings._instance.addressSets.addresses) + if (set.ID == id) + { + set.Name = result; + Settings.Save(); + RefreshAddressSetListItems(cus_id); + break; + } + } + } + catch (Exception ex) + { + MessageBox.Show(this, ex.StackTrace, "Fehler"); + } + } } \ No newline at end of file