[chore:] show details for selected items

This commit is contained in:
2025-09-01 10:20:46 +02:00
parent 5e04834cb2
commit 572209955f
2 changed files with 54 additions and 1 deletions

View File

@@ -14,7 +14,10 @@
VerticalAlignment="Stretch" Margin="10,80,10,0" /> VerticalAlignment="Stretch" Margin="10,80,10,0" />
<!-- <Button x:Name="BtnUpdateFilter" Content="Aktualisieren" HorizontalAlignment="Stretch" --> <!-- <Button x:Name="BtnUpdateFilter" Content="Aktualisieren" HorizontalAlignment="Stretch" -->
<!-- VerticalAlignment="Bottom" Margin="10,0,10,10" Click="BtnUpdateFilter_OnClick" /> --> <!-- VerticalAlignment="Bottom" Margin="10,0,10,10" Click="BtnUpdateFilter_OnClick" /> -->
<Button Content="Ausgewählte Anzeigen" x:Name="BtnShwoSelected" Click="BtnShwoSelected_OnClick"
Margin="10,10,10,0" />
</Grid> </Grid>
<DataGrid x:Name="DgResult" Grid.Column="1" AutoGenerateColumns="True" /> <DataGrid x:Name="DgResult" Grid.Column="1" AutoGenerateColumns="True" />
</Grid> </Grid>
</Window> </Window>

View File

@@ -1,21 +1,27 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Interactivity; using Avalonia.Interactivity;
using Avalonia.Layout;
namespace Logof_Client; namespace Logof_Client;
public partial class ResultWindow : Window public partial class ResultWindow : Window
{ {
public List<CheckBox> errortypecheckboxes = new(); public List<CheckBox> errortypecheckboxes = new();
public KasAddressList ur_addresses = new();
public List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> ur_result; public List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> ur_result;
public List<CheckBox> warningtypecheckboxes = new(); public List<CheckBox> warningtypecheckboxes = new();
public ResultWindow(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result) public ResultWindow(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result,
KasAddressList ur_addresses)
{ {
InitializeComponent(); InitializeComponent();
ur_result = result; ur_result = result;
this.ur_addresses = ur_addresses;
Load(result); Load(result);
//ViewSingle(200552426);
} }
private void GenerateView(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result) private void GenerateView(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result)
@@ -26,6 +32,36 @@ public partial class ResultWindow : Window
DgResult.ItemsSource = errors; DgResult.ItemsSource = errors;
} }
private void ViewSingle(int refsid)
{
foreach (var result in ur_addresses.KasPersons)
if (result.refsid == refsid)
{
var wind = new Window();
var stp = new StackPanel();
stp.Orientation = Orientation.Horizontal;
stp.Margin = new Thickness(10);
var tb = new TextBlock();
var tb2 = new TextBlock();
tb.Text =
"refsid:\nanrede:\ntitel:\nvorname:\nadel:\nname:\nnamezus:\nanredzus:\nstrasse:\nstrasse2:\nplz:\nort:\nland:\npplz:\npostfach:\nname1:\nname2:\nname3:\nname4:\nname5:\nfunktion:\nfunktion2:\nabteilung:\nfunktionad:";
tb2.Text = result.refsid + "\n" + result.anrede + "\n" + result.titel + "\n" + result.vorname + "\n" +
result.adel + "\n" + result.name + "\n" + result.namezus + "\n" + result.anredzus + "\n" +
result.strasse + "\n" + result.strasse2 + "\n" + result.plz + "\n" + result.ort + "\n" +
result.land + "\n" + result.pplz + "\n" + result.postfach + "\n" + result.name1 + "\n" +
result.name2 + "\n" + result.name3 + "\n" + result.name4 + "\n" + result.name5 + "\n" +
result.funktion + "\n" + result.funktion2 + "\n" + result.abteilung + "\n" +
result.funktionad;
stp.Children.Add(tb);
stp.Children.Add(tb2);
wind.Content = stp;
wind.ShowInTaskbar = false;
wind.SizeToContent = SizeToContent.WidthAndHeight;
wind.Show();
return;
}
}
private void Load(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result) private void Load(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result)
{ {
var knownErrors = new List<AddressCheck.ErrorTypes>(); var knownErrors = new List<AddressCheck.ErrorTypes>();
@@ -103,4 +139,18 @@ public partial class ResultWindow : Window
LblResultCount.Content = $"{errors.Count}/{ur_result.Count} Ergebnisse"; LblResultCount.Content = $"{errors.Count}/{ur_result.Count} Ergebnisse";
DgResult.ItemsSource = errors; DgResult.ItemsSource = errors;
} }
private void BtnShwoSelected_OnClick(object? sender, RoutedEventArgs e)
{
foreach (var selected in DgResult.SelectedItems)
try
{
var _asKas = (KasPersonError)selected;
ViewSingle(_asKas.refsid);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
} }