[chore:] deleting address sets
This commit is contained in:
@@ -78,6 +78,14 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem x:Name="MnIAdSetDelete" Click="MnIAdSetDelete_OnClick">
|
||||||
|
<MenuItem.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<LucideIcon Kind="Trash" Width="12" Height="12" Size="12" />
|
||||||
|
<Label Content="Löschen" VerticalContentAlignment="Center" />
|
||||||
|
</StackPanel>
|
||||||
|
</MenuItem.Header>
|
||||||
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</ListBox.ContextMenu>
|
</ListBox.ContextMenu>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|||||||
@@ -914,4 +914,31 @@ public partial class MainWindow : Window
|
|||||||
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void MnIAdSetDelete_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (LstCustomerAdressSets.SelectedItems.Count > 0)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = await MessageBox.Show(this, "Wirklich löschen?", "Wirklich?", MessageBoxButton.YesNo);
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user