101 lines
3.4 KiB
Plaintext
101 lines
3.4 KiB
Plaintext
@using Shared.DTOs
|
|
<Modal @ref="modal" />
|
|
|
|
<Grid TItem="InvoiceItemDTO"
|
|
Class="table table-hover table-bordered table-striped"
|
|
DataProvider="DataProvider"
|
|
AllowPaging="true"
|
|
PageSize="10"
|
|
OnRowClick="OnRowClick"
|
|
Responsive="true">
|
|
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="شناسه">
|
|
@context.ID
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="کد">
|
|
@context.CODID
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="کالا">
|
|
@context.sstt
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="واحد">
|
|
@context.mu
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="تعداد/مقدار">
|
|
@context.am
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ واحد">
|
|
@context.fee
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="نرخ مالیات">
|
|
@context.vra
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ مالیات">
|
|
@context.vam
|
|
</GridColumn>
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="تخفیف">
|
|
@context.dis
|
|
</GridColumn>
|
|
@* <GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ بعد از تخفیف">
|
|
@context.adis
|
|
</GridColumn> *@
|
|
<GridColumn TItem="InvoiceItemDTO" HeaderText="مبلغ کل">
|
|
@context.tsstam
|
|
</GridColumn>
|
|
</Grid>
|
|
|
|
|
|
@code {
|
|
[Parameter] public EventCallback<string> OnMultipleOfThree { get; set; }
|
|
[Parameter] public IEnumerable<InvoiceItemDTO> InvoiceItems { get; set; }
|
|
private Modal modal = default!;
|
|
private async Task<GridDataProviderResult<InvoiceItemDTO>> DataProvider(GridDataProviderRequest<InvoiceItemDTO> 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<InvoiceItemDTO> args)
|
|
{
|
|
var parameters = new Dictionary<string, object>();
|
|
|
|
|
|
parameters.Add("itemDTO", args.Item);
|
|
parameters.Add("OnMultipleOfThree", EventCallback.Factory.Create<ActionInResultComponent>(this, CallBack));
|
|
await modal.ShowAsync<CUSComponent.InvoiceItem>(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="آیتم با موفقیت حذف شد";
|
|
}
|
|
|
|
// if (result.Status == ComponentStatus.success)
|
|
// await LoadCod(1);
|
|
|
|
await modal.HideAsync();
|
|
}
|
|
private IEnumerable<InvoiceItemDTO> GetInvoiceItems()
|
|
{
|
|
return new List<InvoiceItemDTO>();
|
|
|
|
}
|
|
|
|
} |