@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 {
[Parameter] public int InvoiceID { 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));
}
private async Task OnRowClick(GridRowEventArgs args)
{
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();
}
}