Sistemati filtri

This commit is contained in:
2025-07-31 15:24:45 +02:00
parent 068723f31f
commit 8dfb163cfa
8 changed files with 63 additions and 32 deletions

View File

@@ -1,5 +1,4 @@
@using salesbook.Shared.Components.Pages
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Entity
@using salesbook.Shared.Core.Interface
@inject IManageDataService manageData
@@ -19,7 +18,7 @@
<div class="form-container">
<span class="disable-full-width">Con agente</span>
<MudCheckBox @bind-Value="Filter.ConAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeAgente"/>
<MudCheckBox @bind-Value="Filter.ConAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeConAgente"/>
</div>
<div class="divider"></div>
@@ -27,7 +26,7 @@
<div class="form-container">
<span class="disable-full-width">Senza agente</span>
<MudCheckBox @bind-Value="Filter.SenzaAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeAgente"/>
<MudCheckBox @bind-Value="Filter.SenzaAgente" Color="Color.Primary" @bind-Value:after="OnAfterChangeSenzaAgente"/>
</div>
<div class="divider"></div>
@@ -89,7 +88,7 @@
</div>
<div class="button-section">
<MudButton OnClick="() => Filter = new FilterUserDTO()" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
<MudButton OnClick="ClearFilters" Variant="Variant.Outlined" Color="Color.Error">Pulisci</MudButton>
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OnFilterButton">Filtra</MudButton>
</div>
</div>
@@ -140,16 +139,19 @@
Filter.SenzaAgente = false;
}
private void OnAfterChangeAgente()
private void ClearFilters()
{
if (Filter.SenzaAgente)
{
Filter.ConAgente = false;
}
else if (Filter.ConAgente)
{
Filter.SenzaAgente = false;
}
Filter.ConAgente = false;
Filter.SenzaAgente = false;
Filter.Agenti = [];
Filter.Indirizzo = null;
Filter.Citta = null;
Filter.Nazione = null;
Filter.Prov = null;
}
private void OnAfterChangeConAgente() => Filter.SenzaAgente = false;
private void OnAfterChangeSenzaAgente() => Filter.ConAgente = false;
}