fix bug
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
@using Shared.DTOs
|
||||
@inject HttpClientController hc;
|
||||
<Modal @ref="modal" />
|
||||
<ConfirmDialog @ref="dialog" />
|
||||
<form>
|
||||
@* alert *@
|
||||
<div class="row">
|
||||
@@ -95,7 +96,7 @@ else
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
ثبت تغییرات
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="OnClickDelete" Type="ButtonType.Button">
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
@if (_UsedInTheInvoice)
|
||||
@@ -109,6 +110,7 @@ else
|
||||
|
||||
|
||||
@code {
|
||||
private ConfirmDialog dialog = default!;
|
||||
private Modal modal = default!;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
@@ -244,6 +246,21 @@ else
|
||||
}
|
||||
else ShowDangerAlert("فیلدهای قرمز باید مقدار دهی شوند");
|
||||
}
|
||||
|
||||
private async Task ShowConfirmationDeleteAsync()
|
||||
{
|
||||
if (Cod.ID.HasValue && Cod.ID.Value > 0)
|
||||
{
|
||||
var confirmation = await dialog.ShowAsync(
|
||||
title: "عملیات حذف کالا",
|
||||
message1: $"از حذف کالای {Cod.Title}",
|
||||
message2: "اطمینان دارید?");
|
||||
|
||||
if (confirmation)
|
||||
await OnClickDelete();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user