[chore:] combine split into four possible variants of merging

This commit is contained in:
Elias Fierke
2025-10-09 10:21:42 +02:00
parent c4663e489e
commit 63d430dd72
2 changed files with 502 additions and 445 deletions

View File

@@ -3,6 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
MinWidth="1000" MinHeight="600"
x:Class="Logof_Client.MainWindow" WindowState="Maximized" Icon="assets/icon.ico" x:Class="Logof_Client.MainWindow" WindowState="Maximized" Icon="assets/icon.ico"
Title="Logof Client"> Title="Logof Client">
<Border> <Border>
@@ -145,9 +146,53 @@
</Button> </Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Grid Grid.Row="2" Margin="20"> <Grid Grid.Row="2" Margin="20" IsVisible="True" x:Name="GrdCalcMan">
<Image Source="assets/calc_man.png" VerticalAlignment="Center" HorizontalAlignment="Center" /> <Image Source="assets/calc_man.png" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Grid> </Grid>
<Grid Grid.Row="2" Margin="20" IsVisible="False" x:Name="GrdCombineTypes">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10"
Margin="5,0,0,0">
<Button HorizontalAlignment="Stretch" MinWidth="240"
HorizontalContentAlignment="Center" x:Name="BtnCombineUnion"
Margin="0,0,0,10">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="SquaresUnite" Width="36" Height="36" />
<Label Content="Vereinigung" VerticalContentAlignment="Center" FontSize="15"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button HorizontalAlignment="Stretch" MinWidth="240"
HorizontalContentAlignment="Center" x:Name="BtnCombineIntersect"
Margin="0,0,0,10">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="SquaresIntersect" Width="36" Height="36" />
<Label Content="Schnittmenge" VerticalContentAlignment="Center"
FontSize="15"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button HorizontalAlignment="Stretch" MinWidth="240"
HorizontalContentAlignment="Center" x:Name="BtnCombineDifference"
Margin="0,0,0,10">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="SquaresSubtract" Width="36" Height="36" />
<Label Content="Differenz" VerticalContentAlignment="Center"
FontSize="15"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button HorizontalAlignment="Stretch" MinWidth="240"
HorizontalContentAlignment="Center" x:Name="BtnCombineSymmetric"
Margin="0,0,0,10">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="SquaresExclude" Width="36" Height="36" />
<Label Content="Symmetrische Differenz" VerticalContentAlignment="Center"
FontSize="15"
FontWeight="Bold" />
</StackPanel>
</Button>
</StackPanel>
</Grid>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem IsEnabled="False"> <TabItem IsEnabled="False">

View File

@@ -108,6 +108,7 @@ public partial class MainWindow : Window
private void BtnCheck_OnClick(object? sender, RoutedEventArgs e) private void BtnCheck_OnClick(object? sender, RoutedEventArgs e)
{ {
MakeCalcManVisible();
if (LstCustomerAdressSets.SelectedIndex == -1) if (LstCustomerAdressSets.SelectedIndex == -1)
{ {
MessageBox.Show(null, "Bitte zunächst ein Adress-Set auswählen", "Kein Adress-Set ausgewählt"); MessageBox.Show(null, "Bitte zunächst ein Adress-Set auswählen", "Kein Adress-Set ausgewählt");
@@ -135,17 +136,19 @@ public partial class MainWindow : Window
private void BtnCombine_OnClick(object? sender, RoutedEventArgs e) private void BtnCombine_OnClick(object? sender, RoutedEventArgs e)
{ {
if (filePath == null) GrdCalcMan.IsVisible = false;
{ GrdCombineTypes.IsVisible = true;
MessageBox.Show(null, "Bitte zunächst eine Datei auswählen", "Datei fehlt"); }
return;
}
StartCombine(filePath); private void MakeCalcManVisible()
{
GrdCalcMan.IsVisible = true;
GrdCombineTypes.IsVisible = false;
} }
private async void StartCombine(Uri path) private async void StartCombine(Uri path)
{ {
MakeCalcManVisible();
var addresses = DataImport.ImportKasAddressList(path); var addresses = DataImport.ImportKasAddressList(path);
var progressWindow = new ProgressWindow(); var progressWindow = new ProgressWindow();
var address_list = new List<KasAddressList> { addresses.Item2 }; var address_list = new List<KasAddressList> { addresses.Item2 };
@@ -294,6 +297,7 @@ public partial class MainWindow : Window
private void LstCustomers_OnSelectionChanged(object? sender, SelectionChangedEventArgs e) private void LstCustomers_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
MakeCalcManVisible();
if (LstCustomers.SelectedItems == null || LstCustomers.SelectedIndex == -1) return; if (LstCustomers.SelectedItems == null || LstCustomers.SelectedIndex == -1) return;
var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]); var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]);
RefreshAddressSetListItems(customer_id); RefreshAddressSetListItems(customer_id);
@@ -301,6 +305,7 @@ public partial class MainWindow : Window
private async void BtnCustomerAddressSetImport_OnClick(object? sender, RoutedEventArgs e) private async void BtnCustomerAddressSetImport_OnClick(object? sender, RoutedEventArgs e)
{ {
MakeCalcManVisible();
var opts = new FilePickerOpenOptions(); var opts = new FilePickerOpenOptions();
opts.Title = "Address-Set importieren..."; opts.Title = "Address-Set importieren...";
opts.AllowMultiple = false; opts.AllowMultiple = false;
@@ -361,7 +366,14 @@ public partial class MainWindow : Window
public void RefreshAddressSetListItems(int customer_id) public void RefreshAddressSetListItems(int customer_id)
{ {
BtnCheck.IsEnabled = false;
BtnCombine.IsEnabled = false;
BtnGenerateLabels.IsEnabled = false;
BtnRepair.IsEnabled = false;
BtnShorten.IsEnabled = false;
if (LstCustomers.SelectedIndex < 0) return; if (LstCustomers.SelectedIndex < 0) return;
LstCustomerAdressSets.SelectedItems = null; LstCustomerAdressSets.SelectedItems = null;
LstCustomerAdressSets.Items.Clear(); LstCustomerAdressSets.Items.Clear();
foreach (var k in Settings._instance.addressSets.addresses) foreach (var k in Settings._instance.addressSets.addresses)
@@ -372,11 +384,11 @@ public partial class MainWindow : Window
private void LstCustomerAdressSets_OnSelectionChanged(object? sender, SelectionChangedEventArgs e) private void LstCustomerAdressSets_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
MakeCalcManVisible();
if (LstCustomerAdressSets.SelectedItems == null || LstCustomerAdressSets.SelectedIndex == -1) if (LstCustomerAdressSets.SelectedItems == null || LstCustomerAdressSets.SelectedIndex == -1)
{ {
BtnCheck.IsEnabled = false; BtnCheck.IsEnabled = false;
BtnCombine.IsEnabled = false; BtnCombine.IsEnabled = false;
BtnGenerateLabels.IsEnabled = false; BtnGenerateLabels.IsEnabled = false;
BtnRepair.IsEnabled = false; BtnRepair.IsEnabled = false;
BtnShorten.IsEnabled = false; BtnShorten.IsEnabled = false;