Update x ricerca ODL
This commit is contained in:
@@ -365,7 +365,7 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.Where(x => ((inCorso && x.DataFine == null) || (!inCorso && x.DataFine != null)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (x.CodArticolo == codArt || codArt == "*"))
|
||||
.Where(x => ((inCorso && x.DataFine == null) || (!inCorso && x.DataFine != null)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (x.CodArticolo.Contains(codArt) || codArt == "*"))
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxOdl)
|
||||
.ToList();
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<div class="px-2">
|
||||
<i class="fas fa-user-alt"></i> <b>@userName</b>
|
||||
</div>
|
||||
<div class="px-2 flex-grow-1">
|
||||
<div class="px-2 flex-grow-1 text-end">
|
||||
<span class="text-secondary">@TipoSearch</span>
|
||||
</div>
|
||||
<div class="px-2 text-end">
|
||||
@if (ShowSearch)
|
||||
@@ -29,6 +30,12 @@
|
||||
|
||||
private string userName = "";
|
||||
|
||||
private string TipoSearch
|
||||
{
|
||||
get => MService.TipoSearch;
|
||||
set => MService.TipoSearch = value;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MService.EA_ShowSearch += MService_EA_ShowSearch;
|
||||
|
||||
@@ -63,6 +63,23 @@ namespace MP.SPEC.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
currPage = 1;
|
||||
Task task = UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
@@ -96,6 +113,11 @@ namespace MP.SPEC.Components
|
||||
set => MessageService.numRecord = value;
|
||||
}
|
||||
|
||||
private string SearchVal
|
||||
{
|
||||
get => string.IsNullOrEmpty(MessageService.SearchVal) ? "*" : MessageService.SearchVal;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => MessageService.totalCount;
|
||||
@@ -114,7 +136,7 @@ namespace MP.SPEC.Components
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListODLFilt(true, "*", StatoSel);
|
||||
SearchRecords = await MDService.ListODLFilt(true, SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -61,22 +61,22 @@
|
||||
{
|
||||
EA_ShowSearch?.Invoke();
|
||||
}
|
||||
#if false
|
||||
if (showSearch)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TipoSearch
|
||||
{
|
||||
get => tipoSearch;
|
||||
set
|
||||
{
|
||||
if (tipoSearch != value)
|
||||
{
|
||||
tipoSearch = value;
|
||||
if (EA_ShowSearch != null)
|
||||
{
|
||||
if (EA_ShowSearch != null)
|
||||
{
|
||||
EA_ShowSearch?.Invoke();
|
||||
}
|
||||
EA_ShowSearch?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (EA_HideSearch != null)
|
||||
{
|
||||
EA_HideSearch?.Invoke();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,7 @@
|
||||
|
||||
private string searchVal = "";
|
||||
private bool showSearch;
|
||||
private string tipoSearch = "*";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
|
||||
Reference in New Issue
Block a user