Compare commits
10 Commits
9f0cfd09c3
...
39f068d983
| Author | SHA1 | Date | |
|---|---|---|---|
| 39f068d983 | |||
| 412de903f5 | |||
| b2de5e0813 | |||
| ab0a3c3001 | |||
| a264635abf | |||
| 4bbf3cac1d | |||
| 8ee5d9623c | |||
| 572209955f | |||
| 5e04834cb2 | |||
| 028df0fe91 |
105
AddressCheck.cs
105
AddressCheck.cs
@@ -11,16 +11,25 @@ public class AddressCheck
|
|||||||
{
|
{
|
||||||
PlzTooShort,
|
PlzTooShort,
|
||||||
PlzTooLong,
|
PlzTooLong,
|
||||||
|
PPlzTooShort,
|
||||||
|
PPlzTooLong,
|
||||||
|
|
||||||
|
// empty,
|
||||||
|
FullAddressTooLong,
|
||||||
|
DoubledRefsid,
|
||||||
|
MayBeSameAddress,
|
||||||
|
NoPLZorPPLZ
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum WarningTypes
|
||||||
|
{
|
||||||
NoCity,
|
NoCity,
|
||||||
NoStreet,
|
NoStreet,
|
||||||
NoLastName,
|
NoLastName,
|
||||||
NoFirstName,
|
NoFirstName,
|
||||||
|
|
||||||
// empty,
|
|
||||||
FullAddressTooLong,
|
|
||||||
NoStreetNumber,
|
NoStreetNumber,
|
||||||
DoubledRefsid,
|
NoPLZ,
|
||||||
MayBeSameAddress
|
NoPPLZ
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly ProgressWindow _progress;
|
private readonly ProgressWindow _progress;
|
||||||
@@ -30,9 +39,9 @@ public class AddressCheck
|
|||||||
_progress = progressWindow;
|
_progress = progressWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<(int, List<ErrorTypes>)>> Perform(KasAddressList addresses)
|
public async Task<List<(int, List<ErrorTypes>, List<WarningTypes>)>> Perform(KasAddressList addresses)
|
||||||
{
|
{
|
||||||
var failed_refsids = new List<(int, List<ErrorTypes>)>();
|
var failed_refsids = new List<(int, List<ErrorTypes>, List<WarningTypes>)>();
|
||||||
var total = addresses.KasPersons.Count;
|
var total = addresses.KasPersons.Count;
|
||||||
var current = 0;
|
var current = 0;
|
||||||
|
|
||||||
@@ -41,36 +50,78 @@ public class AddressCheck
|
|||||||
foreach (var person in addresses.KasPersons)
|
foreach (var person in addresses.KasPersons)
|
||||||
{
|
{
|
||||||
var errors = new List<ErrorTypes>();
|
var errors = new List<ErrorTypes>();
|
||||||
|
var warnings = new List<WarningTypes>();
|
||||||
var hasFaults = false;
|
var hasFaults = false;
|
||||||
|
|
||||||
var address_component_count = 2; // cause anrede and name are first
|
var address_component_count = 2; // cause anrede and name are first
|
||||||
|
|
||||||
// Prüfung
|
// PLZ-Prüfung
|
||||||
if ((person.plz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
|
if (person.plz == 0 || person.plz == null)
|
||||||
(person.plz < 10000 && person.land == "GER") ||
|
|
||||||
(person.plz < 10000 && person.land == "DE"))
|
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.PlzTooShort);
|
warnings.Add(WarningTypes.NoPLZ);
|
||||||
}
|
}
|
||||||
else if ((person.plz > 99999 && string.IsNullOrWhiteSpace(person.land)) ||
|
else
|
||||||
(person.plz > 99999 && person.land == "GER") ||
|
|
||||||
(person.plz > 99999 && person.land == "DE"))
|
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
if ((person.plz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||||
errors.Add(ErrorTypes.PlzTooLong);
|
(person.plz < 10000 && person.land == "GER") ||
|
||||||
|
(person.plz < 10000 && person.land == "DE"))
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
errors.Add(ErrorTypes.PlzTooShort);
|
||||||
|
}
|
||||||
|
else if ((person.plz > 99999 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||||
|
(person.plz > 99999 && person.land == "GER") ||
|
||||||
|
(person.plz > 99999 && person.land == "DE"))
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
errors.Add(ErrorTypes.PlzTooLong);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// PPLZ-Prüfung
|
||||||
|
if (person.pplz == 0 || person.pplz == null)
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
warnings.Add(WarningTypes.NoPPLZ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((person.pplz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||||
|
(person.pplz < 10000 && person.land == "GER") ||
|
||||||
|
(person.pplz < 10000 && person.land == "DE"))
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
errors.Add(ErrorTypes.PPlzTooShort);
|
||||||
|
}
|
||||||
|
else if ((person.pplz > 99999 && string.IsNullOrWhiteSpace(person.land)) ||
|
||||||
|
(person.pplz > 99999 && person.land == "GER") ||
|
||||||
|
(person.pplz > 99999 && person.land == "DE"))
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
errors.Add(ErrorTypes.PPlzTooLong);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (warnings.Contains(WarningTypes.NoPLZ) && warnings.Contains(WarningTypes.NoPPLZ))
|
||||||
|
{
|
||||||
|
hasFaults = true;
|
||||||
|
errors.Add(ErrorTypes.NoPLZorPPLZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ort-Prüfung
|
||||||
if (string.IsNullOrWhiteSpace(person.ort))
|
if (string.IsNullOrWhiteSpace(person.ort))
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.NoCity);
|
warnings.Add(WarningTypes.NoCity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
address_component_count++;
|
address_component_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Street-Number
|
||||||
var street = person.strasse.ToCharArray();
|
var street = person.strasse.ToCharArray();
|
||||||
var intcount = 0;
|
var intcount = 0;
|
||||||
foreach (var c in street)
|
foreach (var c in street)
|
||||||
@@ -82,32 +133,35 @@ public class AddressCheck
|
|||||||
if (intcount == 0)
|
if (intcount == 0)
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.NoStreetNumber);
|
warnings.Add(WarningTypes.NoStreetNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Last-Name
|
||||||
if (string.IsNullOrWhiteSpace(person.name))
|
if (string.IsNullOrWhiteSpace(person.name))
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.NoLastName);
|
warnings.Add(WarningTypes.NoLastName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First-Name
|
||||||
if (string.IsNullOrWhiteSpace(person.vorname))
|
if (string.IsNullOrWhiteSpace(person.vorname))
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.NoFirstName);
|
warnings.Add(WarningTypes.NoFirstName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Street-Check
|
||||||
if (string.IsNullOrWhiteSpace(person.strasse))
|
if (string.IsNullOrWhiteSpace(person.strasse))
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
errors.Add(ErrorTypes.NoStreet);
|
warnings.Add(WarningTypes.NoStreet);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
address_component_count++;
|
address_component_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Address-Component-Count
|
||||||
if (!string.IsNullOrWhiteSpace(person.strasse2)) address_component_count++;
|
if (!string.IsNullOrWhiteSpace(person.strasse2)) address_component_count++;
|
||||||
if (!string.IsNullOrWhiteSpace(person.land)) address_component_count++;
|
if (!string.IsNullOrWhiteSpace(person.land)) address_component_count++;
|
||||||
if (!string.IsNullOrWhiteSpace(person.name1)) address_component_count++;
|
if (!string.IsNullOrWhiteSpace(person.name1)) address_component_count++;
|
||||||
@@ -120,7 +174,7 @@ public class AddressCheck
|
|||||||
if (!string.IsNullOrWhiteSpace(person.funktionad)) address_component_count++;
|
if (!string.IsNullOrWhiteSpace(person.funktionad)) address_component_count++;
|
||||||
if (!string.IsNullOrWhiteSpace(person.abteilung)) address_component_count++;
|
if (!string.IsNullOrWhiteSpace(person.abteilung)) address_component_count++;
|
||||||
|
|
||||||
|
// Double-Refsid or DoubleAddresses
|
||||||
foreach (var person2 in addresses.KasPersons)
|
foreach (var person2 in addresses.KasPersons)
|
||||||
{
|
{
|
||||||
if (addresses.KasPersons.IndexOf(person) == addresses.KasPersons.IndexOf(person2)) continue;
|
if (addresses.KasPersons.IndexOf(person) == addresses.KasPersons.IndexOf(person2)) continue;
|
||||||
@@ -151,6 +205,7 @@ public class AddressCheck
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adressen-Länge
|
||||||
if (address_component_count > 10)
|
if (address_component_count > 10)
|
||||||
{
|
{
|
||||||
hasFaults = true;
|
hasFaults = true;
|
||||||
@@ -160,7 +215,7 @@ public class AddressCheck
|
|||||||
if (hasFaults)
|
if (hasFaults)
|
||||||
lock (failed_refsids)
|
lock (failed_refsids)
|
||||||
{
|
{
|
||||||
failed_refsids.Add((person.refsid, errors));
|
failed_refsids.Add((person.refsid, errors, warnings));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fortschritt aktualisieren
|
// Fortschritt aktualisieren
|
||||||
|
|||||||
@@ -16,18 +16,25 @@ public class CombineAddresses
|
|||||||
public async Task<KasAddressList> Perform(List<KasAddressList> address_lists)
|
public async Task<KasAddressList> Perform(List<KasAddressList> address_lists)
|
||||||
{
|
{
|
||||||
KasAddressList result = new();
|
KasAddressList result = new();
|
||||||
for (var i = 0; i < address_lists.Count; i++)
|
await Task.Run(async () =>
|
||||||
if (i == 0)
|
{
|
||||||
result = address_lists[i];
|
for (var i = 0; i < address_lists.Count; i++)
|
||||||
else
|
if (i == 0)
|
||||||
result = await Merge(result, address_lists[i], i + 1, address_lists.Count);
|
lock (result)
|
||||||
|
{
|
||||||
|
result = address_lists[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
lock (result)
|
||||||
|
{
|
||||||
|
result = Merge(result, address_lists[i], i + 1, address_lists.Count).Result;
|
||||||
|
}
|
||||||
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<KasAddressList> Merge(KasAddressList first, KasAddressList second, int num, int total)
|
private async Task<KasAddressList> Merge(KasAddressList first, KasAddressList second, int num, int total)
|
||||||
{
|
{
|
||||||
KasAddressList result = new();
|
|
||||||
foreach (var sec in second.KasPersons)
|
foreach (var sec in second.KasPersons)
|
||||||
{
|
{
|
||||||
var is_new = true;
|
var is_new = true;
|
||||||
@@ -68,7 +75,7 @@ public class CombineAddresses
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_new) result.KasPersons.Add(sec);
|
if (is_new) first.KasPersons.Add(sec);
|
||||||
var subperc = second.KasPersons.IndexOf(sec) / second.KasPersons.Count;
|
var subperc = second.KasPersons.IndexOf(sec) / second.KasPersons.Count;
|
||||||
var percent = (num + (double)subperc) / total * 100;
|
var percent = (num + (double)subperc) / total * 100;
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
@@ -82,6 +89,6 @@ public class CombineAddresses
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ public class DataImport
|
|||||||
ParseInt(parts[10]),
|
ParseInt(parts[10]),
|
||||||
parts[11],
|
parts[11],
|
||||||
parts[12],
|
parts[12],
|
||||||
parts[13],
|
ParseInt(parts[13]),
|
||||||
parts[14],
|
parts[14],
|
||||||
parts[15],
|
parts[15],
|
||||||
parts[16],
|
parts[16],
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Logof_Client;
|
namespace Logof_Client;
|
||||||
@@ -29,7 +30,7 @@ public class KasPerson
|
|||||||
plz = 0;
|
plz = 0;
|
||||||
ort = "";
|
ort = "";
|
||||||
land = "";
|
land = "";
|
||||||
pplz = "";
|
pplz = 0;
|
||||||
postfach = "";
|
postfach = "";
|
||||||
name1 = "";
|
name1 = "";
|
||||||
name2 = "";
|
name2 = "";
|
||||||
@@ -55,15 +56,15 @@ public class KasPerson
|
|||||||
int plz,
|
int plz,
|
||||||
string ort,
|
string ort,
|
||||||
string land,
|
string land,
|
||||||
string pplz,
|
int pplz,
|
||||||
string postfach,
|
string postfach,
|
||||||
string name1,
|
string name1,
|
||||||
string name2,
|
string name2,
|
||||||
string name3,
|
string name3,
|
||||||
string name4,
|
string name4,
|
||||||
string name5,
|
string name5,
|
||||||
string funktion,
|
string funktion, // ignorieren
|
||||||
string funktion2,
|
string funktion2, // ignorieren
|
||||||
string abteilung,
|
string abteilung,
|
||||||
string funktionad)
|
string funktionad)
|
||||||
{
|
{
|
||||||
@@ -106,7 +107,7 @@ public class KasPerson
|
|||||||
public int plz { get; set; }
|
public int plz { get; set; }
|
||||||
public string ort { get; set; }
|
public string ort { get; set; }
|
||||||
public string land { get; set; }
|
public string land { get; set; }
|
||||||
public string pplz { get; set; }
|
public int pplz { get; set; }
|
||||||
public string postfach { get; set; }
|
public string postfach { get; set; }
|
||||||
public string name1 { get; set; }
|
public string name1 { get; set; }
|
||||||
public string name2 { get; set; }
|
public string name2 { get; set; }
|
||||||
@@ -121,14 +122,35 @@ public class KasPerson
|
|||||||
|
|
||||||
public class KasPersonError
|
public class KasPersonError
|
||||||
{
|
{
|
||||||
public KasPersonError((int, List<AddressCheck.ErrorTypes>) single_result)
|
public KasPersonError((int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>) single_result)
|
||||||
{
|
{
|
||||||
refsid = single_result.Item1;
|
refsid = single_result.Item1;
|
||||||
foreach (var err in single_result.Item2) errors += err + ", ";
|
try
|
||||||
errors = errors.Trim();
|
{
|
||||||
errors = errors.TrimEnd(',');
|
foreach (var err in single_result.Item2) errors += err + ", ";
|
||||||
|
errors = errors.Trim();
|
||||||
|
errors = errors.TrimEnd(',');
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (single_result.Item3 != null)
|
||||||
|
{
|
||||||
|
foreach (var err in single_result.Item3) warnings += err + ", ";
|
||||||
|
warnings = warnings.Trim();
|
||||||
|
warnings = warnings.TrimEnd(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int refsid { get; set; }
|
public int refsid { get; set; }
|
||||||
public string errors { get; set; }
|
public string errors { get; set; } = "";
|
||||||
|
public string warnings { get; set; } = "";
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
|
||||||
|
|
||||||
namespace Logof_Client;
|
namespace Logof_Client;
|
||||||
|
|
||||||
@@ -53,14 +52,13 @@ public partial class MainWindow : Window
|
|||||||
progressWindow.Close();
|
progressWindow.Close();
|
||||||
|
|
||||||
// Ergebnis anzeigen, z.B. als Dialog
|
// Ergebnis anzeigen, z.B. als Dialog
|
||||||
new ResultWindow(result).Show();
|
new ResultWindow(result, addresses.Item2).Show();
|
||||||
//await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig");
|
//await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
|
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MnuAbout_OnClick(object? sender, RoutedEventArgs e)
|
private void MnuAbout_OnClick(object? sender, RoutedEventArgs e)
|
||||||
@@ -172,13 +170,10 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
|
|
||||||
progressWindow.Close();
|
progressWindow.Close();
|
||||||
File.WriteAllText(Dispatcher.UIThread.Invoke(() => OpenSettingsSaveAsDialog()).Result,
|
File.WriteAllText(OpenSettingsSaveAsDialog().Result,
|
||||||
new CsvBuilder(
|
new CsvBuilder(
|
||||||
"refsid,anrede,titel,vorname,adel,name,namezus,anredzus,strasse,strasse2,plz,ort,land,pplz,postfach,name1,name2,name3,name4,name5,funktion,funktion2,abteilung,funktionad,lastupdate",
|
"refsid,anrede,titel,vorname,adel,name,namezus,anredzus,strasse,strasse2,plz,ort,land,pplz,postfach,name1,name2,name3,name4,name5,funktion,funktion2,abteilung,funktionad,lastupdate",
|
||||||
result).BuildKas());
|
result).BuildKas());
|
||||||
|
|
||||||
|
|
||||||
//new ResultWindow(result).Show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> OpenSettingsSaveAsDialog()
|
private async Task<string> OpenSettingsSaveAsDialog()
|
||||||
|
|||||||
@@ -14,7 +14,11 @@
|
|||||||
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" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
|
||||||
|
x:Name="BtnShwoSelected" Click="BtnShwoSelected_OnClick"
|
||||||
|
Margin="10,10,10,10" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<DataGrid x:Name="DgResult" Grid.Column="1" AutoGenerateColumns="True" />
|
<DataGrid x:Name="DgResult" Grid.Column="1" AutoGenerateColumns="True" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,23 +1,30 @@
|
|||||||
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 List<(int, List<AddressCheck.ErrorTypes>)> ur_result;
|
public KasAddressList ur_addresses = new();
|
||||||
|
public List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> ur_result;
|
||||||
|
public List<CheckBox> warningtypecheckboxes = new();
|
||||||
|
|
||||||
public ResultWindow(List<(int, List<AddressCheck.ErrorTypes>)> 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>)> result)
|
private void GenerateView(List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)> result)
|
||||||
{
|
{
|
||||||
var errors = new List<KasPersonError>();
|
var errors = new List<KasPersonError>();
|
||||||
foreach (var single_result in result) errors.Add(new KasPersonError(single_result));
|
foreach (var single_result in result) errors.Add(new KasPersonError(single_result));
|
||||||
@@ -25,14 +32,52 @@ public partial class ResultWindow : Window
|
|||||||
DgResult.ItemsSource = errors;
|
DgResult.ItemsSource = errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Load(List<(int, List<AddressCheck.ErrorTypes>)> result)
|
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)
|
||||||
{
|
{
|
||||||
var knownErrors = new List<AddressCheck.ErrorTypes>();
|
var knownErrors = new List<AddressCheck.ErrorTypes>();
|
||||||
|
var knownWarnings = new List<AddressCheck.WarningTypes>();
|
||||||
|
|
||||||
foreach (var single_result in result)
|
foreach (var single_result in result)
|
||||||
foreach (var errtyp in single_result.Item2)
|
{
|
||||||
if (!knownErrors.Contains(errtyp))
|
foreach (var errtyp in single_result.Item2)
|
||||||
knownErrors.Add(errtyp);
|
if (!knownErrors.Contains(errtyp))
|
||||||
|
knownErrors.Add(errtyp);
|
||||||
|
|
||||||
|
foreach (var wartyp in single_result.Item3)
|
||||||
|
if (!knownWarnings.Contains(wartyp))
|
||||||
|
knownWarnings.Add(wartyp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (var errtype in knownErrors)
|
foreach (var errtype in knownErrors)
|
||||||
{
|
{
|
||||||
@@ -44,6 +89,16 @@ public partial class ResultWindow : Window
|
|||||||
StpFilterOptions.Children.Add(cb);
|
StpFilterOptions.Children.Add(cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var wartype in knownWarnings)
|
||||||
|
{
|
||||||
|
var cb = new CheckBox();
|
||||||
|
cb.IsChecked = true;
|
||||||
|
cb.Content = wartype.ToString();
|
||||||
|
cb.Click += (sender, e) => UpdateFilter();
|
||||||
|
warningtypecheckboxes.Add(cb);
|
||||||
|
StpFilterOptions.Children.Add(cb);
|
||||||
|
}
|
||||||
|
|
||||||
GenerateView(result);
|
GenerateView(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,17 +108,30 @@ public partial class ResultWindow : Window
|
|||||||
|
|
||||||
private void UpdateFilter()
|
private void UpdateFilter()
|
||||||
{
|
{
|
||||||
var temp_result = new List<(int, List<AddressCheck.ErrorTypes>)>();
|
var temp_result = new List<(int, List<AddressCheck.ErrorTypes>, List<AddressCheck.WarningTypes>)>();
|
||||||
var checked_types = new List<AddressCheck.ErrorTypes>();
|
var checked_types = new List<AddressCheck.ErrorTypes>();
|
||||||
|
var checked_types_war = new List<AddressCheck.WarningTypes>();
|
||||||
foreach (var cb in errortypecheckboxes)
|
foreach (var cb in errortypecheckboxes)
|
||||||
if (cb.IsChecked == true)
|
if (cb.IsChecked == true)
|
||||||
checked_types.Add(
|
checked_types.Add(
|
||||||
(AddressCheck.ErrorTypes)Enum.Parse(typeof(AddressCheck.ErrorTypes), cb.Content.ToString()));
|
(AddressCheck.ErrorTypes)Enum.Parse(typeof(AddressCheck.ErrorTypes), cb.Content.ToString()));
|
||||||
|
|
||||||
|
foreach (var cb in warningtypecheckboxes)
|
||||||
|
if (cb.IsChecked == true)
|
||||||
|
checked_types_war.Add(
|
||||||
|
(AddressCheck.WarningTypes)Enum.Parse(typeof(AddressCheck.WarningTypes), cb.Content.ToString()));
|
||||||
|
|
||||||
foreach (var sres in ur_result)
|
foreach (var sres in ur_result)
|
||||||
foreach (var err in sres.Item2)
|
{
|
||||||
if (checked_types.Contains(err) && !temp_result.Contains(sres))
|
foreach (var err in sres.Item2)
|
||||||
temp_result.Add(sres);
|
if (checked_types.Contains(err) && !temp_result.Contains(sres))
|
||||||
|
temp_result.Add(sres);
|
||||||
|
|
||||||
|
foreach (var war in sres.Item3)
|
||||||
|
if (checked_types_war.Contains(war) && !temp_result.Contains(sres))
|
||||||
|
temp_result.Add(sres);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var errors = new List<KasPersonError>();
|
var errors = new List<KasPersonError>();
|
||||||
foreach (var single_result in temp_result) errors.Add(new KasPersonError(single_result));
|
foreach (var single_result in temp_result) errors.Add(new KasPersonError(single_result));
|
||||||
@@ -71,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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
982c4bab1be7433e0655bc9d9093ed492303bd16c33e9bf09c663ad2ef1afbaa
|
7c9a93128a982a1e9b3ed6a98b955291256152e83f2d8c0a81b93bfa11851fbe
|
||||||
|
|||||||
Binary file not shown.
@@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Logof Client")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("Logof Client")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+79e454fa0798dd4d65d644597aab3c43cffc33dc")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+412de903f5b3dfc96eb50f28565ef826c68c4250")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("Logof Client")]
|
[assembly: System.Reflection.AssemblyProductAttribute("Logof Client")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("Logof Client")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("Logof Client")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Von der MSBuild WriteCodeFragment-Klasse generiert.
|
// Generated by the MSBuild WriteCodeFragment class.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
dba61fcf7b622589bad0203aa3dbe33fc04aea760881f5a8d0f36c1b5d8f2535
|
106552b4e3cc179639dda17b27641bd40928d1e6b4629b5c3baae2909de72cef
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
"net9.0"
|
"net9.0"
|
||||||
],
|
],
|
||||||
"sources": {
|
"sources": {
|
||||||
"/usr/lib64/dotnet/library-packs": {},
|
|
||||||
"https://api.nuget.org/v3/index.json": {}
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
@@ -85,12 +84,18 @@
|
|||||||
],
|
],
|
||||||
"assetTargetFallback": true,
|
"assetTargetFallback": true,
|
||||||
"warn": true,
|
"warn": true,
|
||||||
|
"downloadDependencies": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.AspNetCore.App.Ref",
|
||||||
|
"version": "[9.0.8, 9.0.8]"
|
||||||
|
}
|
||||||
|
],
|
||||||
"frameworkReferences": {
|
"frameworkReferences": {
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": {
|
||||||
"privateAssets": "all"
|
"privateAssets": "all"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runtimeIdentifierGraphPath": "/usr/lib64/dotnet/sdk/9.0.106/PortableRuntimeIdentifierGraph.json"
|
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1497,7 +1497,6 @@
|
|||||||
"net9.0"
|
"net9.0"
|
||||||
],
|
],
|
||||||
"sources": {
|
"sources": {
|
||||||
"/usr/lib64/dotnet/library-packs": {},
|
|
||||||
"https://api.nuget.org/v3/index.json": {}
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
@@ -1562,12 +1561,18 @@
|
|||||||
],
|
],
|
||||||
"assetTargetFallback": true,
|
"assetTargetFallback": true,
|
||||||
"warn": true,
|
"warn": true,
|
||||||
|
"downloadDependencies": [
|
||||||
|
{
|
||||||
|
"name": "Microsoft.AspNetCore.App.Ref",
|
||||||
|
"version": "[9.0.8, 9.0.8]"
|
||||||
|
}
|
||||||
|
],
|
||||||
"frameworkReferences": {
|
"frameworkReferences": {
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": {
|
||||||
"privateAssets": "all"
|
"privateAssets": "all"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runtimeIdentifierGraphPath": "/usr/lib64/dotnet/sdk/9.0.106/PortableRuntimeIdentifierGraph.json"
|
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"dgSpecHash": "iFRYA+o6oII=",
|
"dgSpecHash": "aE0qKetUvS8=",
|
||||||
"success": true,
|
"success": true,
|
||||||
"projectFilePath": "/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj",
|
"projectFilePath": "/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj",
|
||||||
"expectedPackageFiles": [
|
"expectedPackageFiles": [
|
||||||
@@ -33,7 +33,8 @@
|
|||||||
"/home/fierke/.nuget/packages/skiasharp.nativeassets.webassembly/2.88.9/skiasharp.nativeassets.webassembly.2.88.9.nupkg.sha512",
|
"/home/fierke/.nuget/packages/skiasharp.nativeassets.webassembly/2.88.9/skiasharp.nativeassets.webassembly.2.88.9.nupkg.sha512",
|
||||||
"/home/fierke/.nuget/packages/skiasharp.nativeassets.win32/2.88.9/skiasharp.nativeassets.win32.2.88.9.nupkg.sha512",
|
"/home/fierke/.nuget/packages/skiasharp.nativeassets.win32/2.88.9/skiasharp.nativeassets.win32.2.88.9.nupkg.sha512",
|
||||||
"/home/fierke/.nuget/packages/system.io.pipelines/8.0.0/system.io.pipelines.8.0.0.nupkg.sha512",
|
"/home/fierke/.nuget/packages/system.io.pipelines/8.0.0/system.io.pipelines.8.0.0.nupkg.sha512",
|
||||||
"/home/fierke/.nuget/packages/tmds.dbus.protocol/0.21.2/tmds.dbus.protocol.0.21.2.nupkg.sha512"
|
"/home/fierke/.nuget/packages/tmds.dbus.protocol/0.21.2/tmds.dbus.protocol.0.21.2.nupkg.sha512",
|
||||||
|
"/home/fierke/.nuget/packages/microsoft.aspnetcore.app.ref/9.0.8/microsoft.aspnetcore.app.ref.9.0.8.nupkg.sha512"
|
||||||
],
|
],
|
||||||
"logs": []
|
"logs": []
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
"restore":{"projectUniqueName":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj","projectName":"Logof Client","projectPath":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj","outputPath":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"/usr/lib64/dotnet/library-packs":{},"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net9.0":{"targetAlias":"net9.0","dependencies":{"Avalonia":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Controls.DataGrid":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Desktop":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Diagnostics":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Fonts.Inter":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Themes.Fluent":{"target":"Package","version":"[11.3.2, )"},"Lucide.Avalonia":{"target":"Package","version":"[0.1.35, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/lib64/dotnet/sdk/9.0.106/PortableRuntimeIdentifierGraph.json"}}
|
"restore":{"projectUniqueName":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj","projectName":"Logof Client","projectPath":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/Logof Client.csproj","outputPath":"/home/fierke/Nextcloud/Documents/source/repos/logofclient/Logof Client/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["net9.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net9.0":{"targetAlias":"net9.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.100"}"frameworks":{"net9.0":{"targetAlias":"net9.0","dependencies":{"Avalonia":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Controls.DataGrid":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Desktop":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Diagnostics":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Fonts.Inter":{"target":"Package","version":"[11.3.2, )"},"Avalonia.Themes.Fluent":{"target":"Package","version":"[11.3.2, )"},"Lucide.Avalonia":{"target":"Package","version":"[0.1.35, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"downloadDependencies":[{"name":"Microsoft.AspNetCore.App.Ref","version":"[9.0.8, 9.0.8]"}],"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/share/dotnet/sdk/9.0.109/PortableRuntimeIdentifierGraph.json"}}
|
||||||
@@ -1 +1 @@
|
|||||||
17520917705843408
|
17581228084312842
|
||||||
@@ -1 +1 @@
|
|||||||
17520918778041105
|
17581228084312842
|
||||||
Reference in New Issue
Block a user