@using Shared.DTOs @context.ID @* @context.CODID *@ @context.sstt @context.mu @context.am.ToString().Split('٫')[0] @context.fee.ToString("N0") @context.vra @context.vam?.ToString("N0") @context.dis?.ToString("N0") @* @context.adis *@ @context.tsstam?.ToString("N0") @code { Grid grid = default!; [Parameter] public int InvoiceID { get; set; } [Parameter] public bool IsDeleted { get; set; } [Parameter] public EventCallback OnMultipleOfThree { get; set; } [Parameter] public IEnumerable InvoiceItems { get; set; } private Modal modal = default!; private async Task> DataProvider(GridDataProviderRequest request) { if (InvoiceItems is null) // pull employees only one time for client-side filtering, sorting, and paging InvoiceItems = GetInvoiceItems(); // call a service or an API to pull the employees return await Task.FromResult(request.ApplyTo(InvoiceItems)); } protected override async Task OnParametersSetAsync() { if(grid != null) await grid.RefreshDataAsync(); await base.OnParametersSetAsync(); } private async Task OnRowClick(GridRowEventArgs args) { if (!IsDeleted) { var parameters = new Dictionary(); parameters.Add("itemDTO", args.Item); parameters.Add("InvoiceID", InvoiceID); parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create(this, CallBack)); await modal.ShowAsync(title: "ویرایش اطلاعات", parameters: parameters); } } public async Task CallBack(ActionInResultComponent result) { string msg = ""; if (result.Action == ComponentAction.add) { if (result.Status == ComponentStatus.success) msg="آیتم جدید با موفقیت اضافه شد"; } else if (result.Action == ComponentAction.update) { if (result.Status == ComponentStatus.success) msg="اطلاعات آیتم با موفقیت ویرایش شد"; } else if (result.Action == ComponentAction.delete) { if (result.Status == ComponentStatus.success) msg="آیتم با موفقیت حذف شد"; } await OnMultipleOfThree.InvokeAsync(msg); // if (result.Status == ComponentStatus.success) // await LoadCod(1); await modal.HideAsync(); } private IEnumerable GetInvoiceItems() { return new List(); } }