Added DEWVN port mappings and allow multi-delete in value port mappings
This commit is contained in:
parent
2608b4fd5a
commit
1c5e938f9a
@ -69,16 +69,22 @@ namespace ENI2.Controls
|
|||||||
|
|
||||||
private async void DelItem_Click(object sender, RoutedEventArgs e)
|
private async void DelItem_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.dataGridValueMappings.SelectedItem is ValueMapping vm)
|
if (this.dataGridValueMappings.SelectedItems.Count > 0)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show($"Are you sure to delete {vm.Key} -> {vm.Value}?", Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==
|
if (MessageBox.Show($"Are you sure to delete the selected values?", Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==
|
||||||
MessageBoxResult.Yes)
|
MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
int result = await DBManagerAsync.DeleteAsync(vm);
|
var selectedItems = new List<ValueMapping>();
|
||||||
if (result == 1)
|
foreach(ValueMapping vm in this.dataGridValueMappings.SelectedItems)
|
||||||
|
selectedItems.Add(vm);
|
||||||
|
foreach(ValueMapping vm in selectedItems)
|
||||||
{
|
{
|
||||||
_mappings.Remove(vm);
|
int result = await DBManagerAsync.DeleteAsync(vm);
|
||||||
}
|
if (result == 1)
|
||||||
|
{
|
||||||
|
_mappings.Remove(vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
misc/db.sqlite
BIN
misc/db.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user