...
This commit is contained in:
@@ -16,21 +16,24 @@
|
||||
<h6 style="color:red">نکته:</h6>
|
||||
|
||||
<ul>
|
||||
<li>در زمان ویرایش نمیتوانید نام کالا را عوض کنید</li>
|
||||
@if (_UsedInTheInvoice)
|
||||
{
|
||||
<li>با این کالا صورتحسابی صادر کرده اید ،نمیتوانید نام کالا را ویرایش کنید</li>
|
||||
}
|
||||
<li>زمان ویرایش دقت کنید تغییرات میتواند روی فاکتورهای صادر شده تائیر بگذارد</li>
|
||||
</ul>
|
||||
}
|
||||
<div class="row g-3">
|
||||
<div class="form-group col-md-6">
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputTitle">نام کالا</label>
|
||||
@if (Cod.ID != 0)
|
||||
@if (Cod.ID == 0 || !_UsedInTheInvoice)
|
||||
{
|
||||
<InputText @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا"
|
||||
readonly />
|
||||
/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<InputText @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا" />
|
||||
<InputText @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا" readonly />
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -95,6 +98,13 @@ else
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="OnClickDelete" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
@if (_UsedInTheInvoice)
|
||||
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
صورتحساب های مرتبط
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,25 +115,43 @@ else
|
||||
IconName alertIconName = IconName.CheckCircleFill;
|
||||
bool Hidealert = true;
|
||||
string alertMessage = "";
|
||||
bool _UsedInTheInvoice = false;
|
||||
[Parameter] public RCOD Cod { get; set; }
|
||||
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
|
||||
[Parameter] public List<IdName<int>>? Unitrequest { get; set; }
|
||||
public ActionInResultComponent result { get; set; }
|
||||
|
||||
|
||||
protected override Task OnParametersSetAsync()
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
|
||||
|
||||
result = new ActionInResultComponent()
|
||||
{
|
||||
Status = ComponentStatus.fild
|
||||
};
|
||||
Hidealert = true;
|
||||
alertMessage = "";
|
||||
return base.OnParametersSetAsync();
|
||||
await UsedInTheInvoice();
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
}
|
||||
@functions {
|
||||
public async Task OnClickGoToInvoice()
|
||||
{
|
||||
hc._nav.NavigateTo($"Invoice/{"cod:" + Cod.ID}");
|
||||
}
|
||||
public async Task UsedInTheInvoice()
|
||||
{
|
||||
if (Cod.ID!=0)
|
||||
{
|
||||
var rsp = await hc.Get($"Cod/UsedInTheInvoice/{Cod.ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
_UsedInTheInvoice = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||
|
||||
else _UsedInTheInvoice = false;
|
||||
}
|
||||
|
||||
}
|
||||
private void ShowSuccessAlert(string msg)
|
||||
{
|
||||
Hidealert = false;
|
||||
|
Reference in New Issue
Block a user