Prospect filter
This commit is contained in:
@@ -11,21 +11,31 @@
|
||||
Color="Color.Primary"
|
||||
Clicked="() => ProspectModal.Show()"
|
||||
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
|
||||
>Hinzufügen</Button>
|
||||
>Hinzufügen
|
||||
</Button>
|
||||
|
||||
@{
|
||||
var filterList = ProspectList;
|
||||
if(!string.IsNullOrWhiteSpace(FilterText))
|
||||
filterList = filterList?.Where(x =>
|
||||
x.Name.Contains(FilterText, StringComparison.OrdinalIgnoreCase) ||
|
||||
x.Memo?.Contains(FilterText, StringComparison.OrdinalIgnoreCase) == true ||
|
||||
x.FsId.ToString().Contains(FilterText, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
}
|
||||
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
<TextEdit TextChanged="FilterText_Changed" Placeholder="Suchen..." Debounce="true" DebounceInterval="150" />
|
||||
|
||||
@if (filterList?.Any() == true)
|
||||
{
|
||||
<div class="row m-0">
|
||||
|
||||
@@ -29,11 +29,8 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the filter text (ab)
|
||||
/// </summary>
|
||||
private string? FilterText { get; set; }
|
||||
|
||||
private ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the interaction modal (ab)
|
||||
/// </summary>
|
||||
@@ -72,19 +69,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method FilterText_Changed
|
||||
|
||||
/// <summary>
|
||||
/// Filters the text changed using the specified filter text (a. beging, 08.02.2023)
|
||||
/// </summary>
|
||||
/// <param name="filterText">The filter text</param>
|
||||
private void FilterText_Changed(string filterText)
|
||||
{
|
||||
FilterText = filterText;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,18 +6,26 @@
|
||||
<h2>Abgeschlossene Einarbeitungen</h2>
|
||||
|
||||
@{
|
||||
var filterList = ProspectList;
|
||||
if(!string.IsNullOrWhiteSpace(FilterText))
|
||||
filterList = filterList?.Where(x =>
|
||||
x.Name.Contains(FilterText, StringComparison.OrdinalIgnoreCase) ||
|
||||
x.Memo?.Contains(FilterText, StringComparison.OrdinalIgnoreCase) == true ||
|
||||
x.FsId.ToString().Contains(FilterText, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
}
|
||||
|
||||
<hr />
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
<TextEdit TextChanged="FilterText_Changed" Placeholder="Suchen..." Debounce="true" DebounceInterval="150" />
|
||||
@if (filterList?.Any() == true)
|
||||
{
|
||||
|
||||
|
||||
@@ -22,10 +22,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the filter text (ab)
|
||||
/// </summary>
|
||||
private string? FilterText { get; set; }
|
||||
private ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect list (ab)
|
||||
@@ -44,19 +41,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method FilterText_Changed
|
||||
|
||||
/// <summary>
|
||||
/// Filters the text changed using the specified filter text (a. beging, 08.02.2023)
|
||||
/// </summary>
|
||||
/// <param name="filterText">The filter text</param>
|
||||
private void FilterText_Changed(string filterText)
|
||||
{
|
||||
FilterText = filterText;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -7,18 +7,26 @@
|
||||
<h2>Freischalten</h2>
|
||||
|
||||
@{
|
||||
var filterList = ProspectList;
|
||||
if(!string.IsNullOrWhiteSpace(FilterText))
|
||||
filterList = filterList?.Where(x =>
|
||||
x.Name.Contains(FilterText, StringComparison.OrdinalIgnoreCase) ||
|
||||
x.Memo?.Contains(FilterText, StringComparison.OrdinalIgnoreCase) == true ||
|
||||
x.FsId.ToString().Contains(FilterText, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
}
|
||||
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
<TextEdit TextChanged="FilterText_Changed" Placeholder="Suchen..." Debounce="true" DebounceInterval="150" />
|
||||
@if (filterList?.Any() == true)
|
||||
{
|
||||
<div class="row m-0">
|
||||
|
||||
@@ -29,10 +29,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the filter text (ab)
|
||||
/// </summary>
|
||||
private string? FilterText { get; set; }
|
||||
private ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the interaction modal (ab)
|
||||
@@ -69,19 +66,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method FilterText_Changed
|
||||
|
||||
/// <summary>
|
||||
/// Filters the text changed using the specified filter text (a. beging, 08.02.2023)
|
||||
/// </summary>
|
||||
/// <param name="filterText">The filter text</param>
|
||||
private void FilterText_Changed(string filterText)
|
||||
{
|
||||
FilterText = filterText;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user