...
This commit is contained in:
@@ -27,30 +27,30 @@
|
||||
@switch (invoice.invoiceType)
|
||||
{
|
||||
case(InvoiceType.Bidding):
|
||||
<button class="button" id="cut"><span>فاکتور</span></button>
|
||||
<button class="button" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.Sale)" id="cut"><span>فاکتور</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.CANCEL)" id="sred1"><span>لغو</span></button>
|
||||
break;
|
||||
|
||||
case (InvoiceType.Sale):
|
||||
<button class="button" id="copy"><span>برگشت فروش</span></button>
|
||||
<button class="button" id="paste"><span>اصلاح</span></button>
|
||||
<button class="button" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.BackFrmSale)" id="copy"><span>برگشت فروش</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.Repair)" id="paste"><span>اصلاح</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.Cancellation)" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" id="sred1" @onclick="() => ChangeStatus(InvoiceType.CANCEL)"><span>لغو</span></button>
|
||||
break;
|
||||
|
||||
case (InvoiceType.BackFrmSale):
|
||||
<button class="button" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.Cancellation)" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.CANCEL)" id="sred1"><span>لغو</span></button>
|
||||
break;
|
||||
|
||||
case (InvoiceType.Repair):
|
||||
<button class="button" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" id="copy"><span>برگشت فروش</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.Cancellation)" id="sred"><span>ابطال</span></button>
|
||||
<button class="button" @onclick="() => ChangeStatus(InvoiceType.CANCEL)" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" id="copy" @onclick="() => ChangeStatus(InvoiceType.BackFrmSale)"><span>برگشت فروش</span></button>
|
||||
break;
|
||||
|
||||
case (InvoiceType.Cancellation):
|
||||
<button class="button" id="sred1"><span>لغو</span></button>
|
||||
<button class="button" id="sred1" @onclick="() => ChangeStatus(InvoiceType.CANCEL)"><span>لغو</span></button>
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -236,6 +236,13 @@
|
||||
<InputText style=" text-align: center;" @bind-Value="invoice.Udate" class="form-control" id="inputUdate" readonly />
|
||||
|
||||
</div>
|
||||
@* @if (invoice.BillReference.HasValue)
|
||||
{
|
||||
<div class="row g-3">
|
||||
<Button Color="ButtonColor.Link"><NavLink href="InvoiceDetails/@invoice.BillReference.Value">صورتحساب مرجع</NavLink></Button>
|
||||
</div>
|
||||
} *@
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<br />
|
||||
@if (InvoiceID == 0 || InvoiceID == null)
|
||||
@@ -337,6 +344,27 @@
|
||||
|
||||
|
||||
}
|
||||
private async Task ChangeStatus(InvoiceType type)
|
||||
{
|
||||
var rsp = await hc.Post<InvoiceType>($"Invoice/ChangeInvoiceType/{InvoiceID}",type);
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var resinvoice = await rsp.Content.ReadFromJsonAsync<InvoiceDTO>();
|
||||
if (resinvoice!=null)
|
||||
{
|
||||
invoice = resinvoice;
|
||||
ShowSuccessAlert("تغییر وضعیت با موفقیت انجام شد");
|
||||
}
|
||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
}
|
||||
else
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
|
Reference in New Issue
Block a user