...
This commit is contained in:
@@ -22,11 +22,15 @@ else
|
||||
|
||||
@* alert *@
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||
@alertMessage
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
@if (FullInvoice)
|
||||
{
|
||||
@@ -305,11 +309,11 @@ else
|
||||
<div class="col-auto">
|
||||
@if (FullInvoice)
|
||||
{
|
||||
<button type="submit" @onclick="Send" class="btn btn-primary">ثبت تغییرات</button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Primary" @onclick="Send">ثبت تغییرات</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="submit" @onclick="Send" class="btn btn-primary">آماده سازی و ارسال</button>
|
||||
<Button Disabled="SpinnerVisible" Color="ButtonColor.Primary" @onclick="Send">آماده سازی و ارسال</Button>
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -322,6 +326,7 @@ else
|
||||
|
||||
|
||||
@code {
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
string patt = "";
|
||||
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
||||
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
||||
@@ -341,10 +346,12 @@ else
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
Patterns = await fv.GetPatternsbyinp();
|
||||
BillTypes = await fv.GetBillTypes();
|
||||
units = await fv.GetUnitsbyUnitTaxID();
|
||||
SpinnerVisible = false;
|
||||
await LoadData();
|
||||
PreloadService.Hide();
|
||||
|
||||
@@ -366,6 +373,7 @@ else
|
||||
};
|
||||
public async Task Send()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
if (!FullInvoice && !await CheckAuth())
|
||||
{
|
||||
ShowMessage(ToastType.Danger, "خطا در احراز هویت سازمان مالیاتی");
|
||||
@@ -421,19 +429,22 @@ else
|
||||
ShowMessage(ToastType.Danger, request[0]);
|
||||
}
|
||||
}
|
||||
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
public async Task<bool> CheckAuth()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
var rsp = await hc.Get($"TaxPayer/CheckAuth");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var response = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||
if (response)
|
||||
{
|
||||
SpinnerVisible = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
return false;
|
||||
}
|
||||
private void ShowSuccessAlert(string msg)
|
||||
@@ -452,7 +463,7 @@ else
|
||||
}
|
||||
private async Task LoadData()
|
||||
{
|
||||
|
||||
SpinnerVisible = true;
|
||||
var rsp = await hc.Get($"TaxPayer/GetInvoice/{InvoiceID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -463,7 +474,7 @@ else
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task ShowConditions(string[]? Conditions, string fild)
|
||||
{
|
||||
|
Reference in New Issue
Block a user