[feat:] implemented renaming functionality

This commit is contained in:
Elias Fierke
2026-01-19 16:25:33 +01:00
parent ee83aca490
commit afbb4626a0

View File

@@ -887,4 +887,31 @@ public partial class MainWindow : Window
MessageBox.Show(this, ex.StackTrace, "Fehler"); 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");
}
}
} }