...
This commit is contained in:
@@ -141,12 +141,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
@if (add)
|
||||
{
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-6">
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="AddPay" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="AddPay" Type="ButtonType.Button">
|
||||
جدید
|
||||
</Button>
|
||||
</div>
|
||||
@@ -155,24 +156,28 @@
|
||||
else
|
||||
{ <div class="row g-3">
|
||||
<div class="form-group col-md-6">
|
||||
<Button class="mt-3" Color="ButtonColor.Info" @onclick="UpdatePay" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Info" @onclick="UpdatePay" Type="ButtonType.Button">
|
||||
ویرایش
|
||||
</Button>
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="DeletePay" Type="ButtonType.Button">
|
||||
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Danger" @onclick="DeletePay" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="cancell" Type="ButtonType.Button">
|
||||
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Primary" @onclick="cancell" Type="ButtonType.Button">
|
||||
انصراف
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div> <div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
private ConfirmDialog dialog = default!;
|
||||
bool add = true;
|
||||
[Parameter] public InvoiceDTO invoice { get; set; }
|
||||
@@ -188,8 +193,9 @@
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
item = new InvoicePaymentDTO();
|
||||
|
||||
SpinnerVisible = true;
|
||||
pmts = await fv.GetPaymentMethods();
|
||||
SpinnerVisible = false;
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
@@ -208,6 +214,7 @@
|
||||
}
|
||||
async Task AddPay()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
Hidealert = true;
|
||||
if (await Validation())
|
||||
{
|
||||
@@ -239,12 +246,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SpinnerVisible = false;
|
||||
|
||||
}
|
||||
async Task UpdatePay()
|
||||
{
|
||||
Hidealert = true;
|
||||
SpinnerVisible = true;
|
||||
if (await Validation())
|
||||
{
|
||||
var rsp = await hc.Put<InvoiceItemAction<InvoicePaymentDTO>>("InvoicePayment/UpdatePay", new InvoiceItemAction<InvoicePaymentDTO>()
|
||||
@@ -275,6 +283,7 @@
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
async Task DeletePay()
|
||||
{
|
||||
@@ -285,6 +294,7 @@
|
||||
|
||||
if (confirmation)
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
Hidealert = true;
|
||||
if (item.ID.HasValue)
|
||||
{
|
||||
@@ -311,6 +321,7 @@
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user