This commit is contained in:
mmrbnjd
2024-10-22 12:31:34 +03:30
parent afd1a5ef8f
commit e748993044
4 changed files with 115 additions and 29 deletions

View File

@@ -14,14 +14,23 @@
</div>
@if (Cod.ID != 0)
{
<h6 style="color:red">نکته:</h6>
<ul>
@if (_UsedInTheInvoice)
@if (_SuccessfulSubmissiontoTaxPayer)
{
<li>با این کالا صورتحسابی صادر کرده اید ،نمیتوانید نام کالا را ویرایش کنید</li>
<li style="color:red">با این کالا صورتحسابی به سامانه مودیان ارسال کرده اید <br />نمیتوانید آن را ویرایش کنید</li>
}
<li>زمان ویرایش دقت کنید تغییرات میتواند روی فاکتورهای صادر شده تائیر بگذارد</li>
else
{
@if (_UsedInTheInvoice)
{
<li style="color:indianred">با این کالا صورتحسابی صادر کرده اید <br />نمیتوانید نام کالا را ویرایش کنید</li>
<br />
}
<li style="color:dodgerblue">زمان ویرایش دقت کنید<br /> تغییرات میتواند روی فاکتورهای صادر شده تائیر بگذارد</li>
}
</ul>
}
<div class="row g-3">
@@ -94,12 +103,16 @@
}
else
{
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
ثبت تغییرات
</Button>
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
حذف
</Button>
@if (!_SuccessfulSubmissiontoTaxPayer)
{
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
ثبت تغییرات
</Button>
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
حذف
</Button>
}
@if (_UsedInTheInvoice)
{
@@ -123,6 +136,7 @@ else
bool Hidealert = true;
string alertMessage = "";
bool _UsedInTheInvoice = false;
bool _SuccessfulSubmissiontoTaxPayer = false;
[Parameter] public RCOD Cod { get; set; }
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
[Parameter] public List<IdName<int>>? Unitrequest { get; set; }
@@ -139,6 +153,7 @@ else
Hidealert = true;
alertMessage = "";
await UsedInTheInvoice();
await SuccessfulSubmissiontoTaxPayer();
SpinnerVisible = false;
await base.OnParametersSetAsync();
}
@@ -160,6 +175,20 @@ else
}
}
public async Task SuccessfulSubmissiontoTaxPayer()
{
SpinnerVisible = true;
if (Cod.ID != 0)
{
var rsp = await hc.Get($"TaxPayer/CodInTaxPayerHaveBeenSentSuccessfully/{Cod.ID}");
if (rsp.IsSuccessStatusCode)
_SuccessfulSubmissiontoTaxPayer = await rsp.Content.ReadFromJsonAsync<bool>();
else _SuccessfulSubmissiontoTaxPayer = false;
}
SpinnerVisible = false ;
}
private void ShowSuccessAlert(string msg)
{
Hidealert = false;