[feat:] address set combining order
This commit is contained in:
+18
-1
@@ -220,7 +220,6 @@
|
||||
<Label FontSize="9"
|
||||
Content="Elemente der ersten Menge ohne Elemente der zweiten Menge" />
|
||||
</StackPanel>
|
||||
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Stretch" MinWidth="240"
|
||||
HorizontalContentAlignment="Center" x:Name="BtnCombineSymmetric"
|
||||
@@ -248,6 +247,24 @@
|
||||
<CheckBox HorizontalAlignment="Left" x:Name="CbMergeDeleteOld" IsChecked="False">Lösche ursprüngliche Sets</CheckBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Label HorizontalAlignment="Center" Content="Reihenfolge:"></Label>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10">
|
||||
<ListBox x:Name="LstCombineAddressSetSort" SelectionMode="Single" SelectionChanged="LstCombineAddressSetSort_OnSelectionChanged"></ListBox>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Button HorizontalAlignment="Stretch" MinWidth="40"
|
||||
HorizontalContentAlignment="Center" x:Name="BtnCombineAddressSetSortUp"
|
||||
Click="BtnCombineAddressSetSortUp_OnClick"
|
||||
Margin="0,0,0,10">
|
||||
<LucideIcon Kind="ArrowBigUp" Width="36" Height="36" />
|
||||
</Button>
|
||||
<Button HorizontalAlignment="Stretch" MinWidth="40"
|
||||
HorizontalContentAlignment="Center" x:Name="BtnCombineAddressSetSortDown"
|
||||
Click="BtnCombineAddressSetSortDown_OnClick"
|
||||
Margin="0,0,0,10">
|
||||
<LucideIcon Kind="ArrowBigDown" Width="36" Height="36" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" Margin="20" ColumnDefinitions="*,5*,*" IsVisible="False" x:Name="GrdExportMarginOptions">
|
||||
|
||||
+65
-4
@@ -669,6 +669,15 @@ public partial class MainWindow : Window
|
||||
BtnRepair.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
LstCombineAddressSetSort.Items.Clear();
|
||||
foreach (var selected in LstCustomerAdressSets.SelectedItems)
|
||||
{
|
||||
try
|
||||
{
|
||||
LstCombineAddressSetSort.Items.Add(selected as KasAddressList);
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
private async void BtnSettingsImportCustomerAddressPatch_OnClick(object? sender, RoutedEventArgs e)
|
||||
@@ -728,7 +737,7 @@ public partial class MainWindow : Window
|
||||
private void BtnCombineDifference_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var list = new List<KasAddressList>();
|
||||
foreach (var item in LstCustomerAdressSets.SelectedItems)
|
||||
foreach (var item in LstCombineAddressSetSort.Items)
|
||||
list.Add((KasAddressList)item);
|
||||
try
|
||||
{
|
||||
@@ -743,7 +752,7 @@ public partial class MainWindow : Window
|
||||
private void BtnCombineUnion_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var list = new List<KasAddressList>();
|
||||
foreach (var item in LstCustomerAdressSets.SelectedItems)
|
||||
foreach (var item in LstCombineAddressSetSort.Items)
|
||||
list.Add((KasAddressList)item);
|
||||
try
|
||||
{
|
||||
@@ -759,7 +768,7 @@ public partial class MainWindow : Window
|
||||
private void BtnCombineIntersection_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var list = new List<KasAddressList>();
|
||||
foreach (var item in LstCustomerAdressSets.SelectedItems)
|
||||
foreach (var item in LstCombineAddressSetSort.Items)
|
||||
list.Add((KasAddressList)item);
|
||||
try
|
||||
{
|
||||
@@ -788,7 +797,7 @@ public partial class MainWindow : Window
|
||||
private void BtnCombineSymmetricDifference_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var list = new List<KasAddressList>();
|
||||
foreach (var item in LstCustomerAdressSets.SelectedItems)
|
||||
foreach (var item in LstCombineAddressSetSort.Items)
|
||||
list.Add((KasAddressList)item);
|
||||
|
||||
StartCombine(list, Convert.ToInt32((LstCustomers.SelectedItem as Customer).ID), "symdiff", GetCombiningTyp());
|
||||
@@ -1301,4 +1310,56 @@ public partial class MainWindow : Window
|
||||
|
||||
StartAddressRepairer((KasAddressList)LstCustomerAdressSets.SelectedItem);
|
||||
}
|
||||
|
||||
private void BtnCombineAddressSetSortUp_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var selected = (LstCombineAddressSetSort.SelectedItem as KasAddressList);
|
||||
int index = LstCombineAddressSetSort.SelectedIndex;
|
||||
if (LstCombineAddressSetSort.SelectedIndex != null && LstCombineAddressSetSort.SelectedIndex != -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
LstCombineAddressSetSort.Items.RemoveAt(index);
|
||||
LstCombineAddressSetSort.Items.Insert(index-1, selected);
|
||||
LstCombineAddressSetSort.SelectedIndex = index - 1;
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnCombineAddressSetSortDown_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var selected = (LstCombineAddressSetSort.SelectedItem as KasAddressList);
|
||||
int index = LstCombineAddressSetSort.SelectedIndex;
|
||||
if (LstCombineAddressSetSort.SelectedIndex != null && LstCombineAddressSetSort.SelectedIndex != -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
LstCombineAddressSetSort.Items.RemoveAt(index);
|
||||
LstCombineAddressSetSort.Items.Insert(index+1, selected);
|
||||
LstCombineAddressSetSort.SelectedIndex = index + 1;
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
private void LstCombineAddressSetSort_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (LstCombineAddressSetSort.SelectedIndex == 0)
|
||||
{
|
||||
BtnCombineAddressSetSortDown.IsEnabled = true;
|
||||
BtnCombineAddressSetSortUp.IsEnabled = false;
|
||||
} else if (LstCombineAddressSetSort.SelectedIndex == LstCombineAddressSetSort.Items.Count - 1)
|
||||
{
|
||||
BtnCombineAddressSetSortUp.IsEnabled = true;
|
||||
BtnCombineAddressSetSortDown.IsEnabled = false;
|
||||
} else if (LstCombineAddressSetSort.SelectedIndex == LstCombineAddressSetSort.Items.Count - 1 && LstCombineAddressSetSort.SelectedIndex == 0)
|
||||
{
|
||||
BtnCombineAddressSetSortUp.IsEnabled = false;
|
||||
BtnCombineAddressSetSortDown.IsEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnCombineAddressSetSortDown.IsEnabled = true;
|
||||
BtnCombineAddressSetSortUp.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user