[feat:] result count for filtering
This commit is contained in:
@@ -13,15 +13,15 @@ public partial class ResultWindow : Window
|
||||
public ResultWindow(List<(int, List<AddressCheck.ErrorTypes>)> result)
|
||||
{
|
||||
InitializeComponent();
|
||||
Load(result);
|
||||
ur_result = result;
|
||||
Load(result);
|
||||
}
|
||||
|
||||
private void GenerateView(List<(int, List<AddressCheck.ErrorTypes>)> result)
|
||||
{
|
||||
var errors = new List<KasPersonError>();
|
||||
foreach (var single_result in result) errors.Add(new KasPersonError(single_result));
|
||||
|
||||
LblResultCount.Content = $"{errors.Count}/{ur_result.Count} Ergebnisse";
|
||||
DgResult.ItemsSource = errors;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public partial class ResultWindow : Window
|
||||
var cb = new CheckBox();
|
||||
cb.IsChecked = true;
|
||||
cb.Content = errtype.ToString();
|
||||
cb.Click += (sender, e) => UpdateFilter();
|
||||
errortypecheckboxes.Add(cb);
|
||||
StpFilterOptions.Children.Add(cb);
|
||||
}
|
||||
@@ -47,6 +48,10 @@ public partial class ResultWindow : Window
|
||||
}
|
||||
|
||||
private void BtnUpdateFilter_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void UpdateFilter()
|
||||
{
|
||||
var temp_result = new List<(int, List<AddressCheck.ErrorTypes>)>();
|
||||
var checked_types = new List<AddressCheck.ErrorTypes>();
|
||||
@@ -57,12 +62,13 @@ public partial class ResultWindow : Window
|
||||
|
||||
foreach (var sres in ur_result)
|
||||
foreach (var err in sres.Item2)
|
||||
if (checked_types.Contains(err))
|
||||
if (checked_types.Contains(err) && !temp_result.Contains(sres))
|
||||
temp_result.Add(sres);
|
||||
|
||||
var errors = new List<KasPersonError>();
|
||||
foreach (var single_result in temp_result) errors.Add(new KasPersonError(single_result));
|
||||
|
||||
LblResultCount.Content = $"{errors.Count}/{ur_result.Count} Ergebnisse";
|
||||
DgResult.ItemsSource = errors;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user