[fix:] make customer delete button working

This commit is contained in:
2026-04-28 10:53:53 +02:00
parent 80d1498cc7
commit 3767fece48
2 changed files with 18 additions and 1 deletions
+17
View File
@@ -1128,4 +1128,21 @@ public partial class MainWindow : Window
MessageBox.Show(this, ex.StackTrace, "Fehler");
}
}
private void BtnDeleteCustomer_OnClick(object? sender, RoutedEventArgs e)
{
if (LstSettingsCustomers.SelectedIndex == null || LstSettingsCustomers.SelectedIndex == -1) return;
foreach (var customer in Settings._instance.customers.customers)
if (customer.ID == Settings._instance.customers.current)
try
{
Settings._instance.customers.customers.Remove(customer);
break;
}
catch (Exception ex)
{
MessageBox.Show(this, "Unknown Error: " + ex.Message, "Error");
}
RefreshCustomerItems();
}
}