74 lines
2.3 KiB
C#
74 lines
2.3 KiB
C#
using AyCode.Utils.Extensions;
|
|
using DevExpress.Blazor;
|
|
using FruitBank.Common.Entities;
|
|
using FruitBank.Common.SignalRs;
|
|
using FruitBankHybrid.Shared.Pages;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace FruitBankHybrid.Shared.Components.Grids.Ekaers;
|
|
|
|
public class GridEkaerHistoryBase : FruitBankGridBase<EkaerHistory>, IGrid
|
|
{
|
|
private bool _isFirstInitializeParameterCore;
|
|
private bool _isFirstInitializeParameters;
|
|
|
|
/// <summary>Szerver-oldali szűrő a master-grid lekérdezéséhez (a tabok adják át). All = minden.</summary>
|
|
[Parameter] public EkaerHistoryFilter Filter { get; set; } = EkaerHistoryFilter.All;
|
|
|
|
public GridEkaerHistoryBase() : base()
|
|
{
|
|
//GetAllMessageTag = SignalRTags.GetEkaerHistories;
|
|
AddMessageTag = SignalRTags.AddEkaerHistory;
|
|
UpdateMessageTag = SignalRTags.UpdateEkaerHistory;
|
|
|
|
//RemoveMessageTag = SignalRTags.;
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (GetAllMessageTag > 0) return;
|
|
|
|
if (IsMasterGrid)
|
|
{
|
|
GetAllMessageTag = SignalRTags.GetEkaerHistories;
|
|
ContextIds = [Filter]; // szerver-oldali szűrő a tabokhoz (All = minden) — a GetEkaerHistories(filter) param-ja
|
|
}
|
|
else
|
|
{
|
|
if (ContextIds == null || ContextIds.Length == 0) ContextIds = [ParentDataItem!.Id];
|
|
|
|
// A ForeignKey általános (Shipping/Order stb.) — bármely szülőnél a ForeignKey-re szűrünk.
|
|
GetAllMessageTag = SignalRTags.GetEkaerHistoriesByForeignKey;
|
|
if (KeyFieldNameToParentId.IsNullOrWhiteSpace()) KeyFieldNameToParentId = nameof(EkaerHistory.ForeignKey);
|
|
}
|
|
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
base.OnParametersSet();
|
|
|
|
if (!_isFirstInitializeParameters)
|
|
{
|
|
_isFirstInitializeParameters = false;
|
|
}
|
|
}
|
|
|
|
protected override async Task SetParametersAsyncCore(ParameterView parameters)
|
|
{
|
|
await base.SetParametersAsyncCore(parameters);
|
|
|
|
if (!_isFirstInitializeParameterCore)
|
|
{
|
|
//ShowFilterRow = true;
|
|
//ShowGroupPanel = true;
|
|
//AllowSort = false;
|
|
|
|
//etc...
|
|
|
|
_isFirstInitializeParameterCore = false;
|
|
}
|
|
}
|
|
}
|