This commit is contained in:
mmrbnjd
2024-07-25 19:15:05 +03:30
parent 630d535962
commit e840978cc1
3 changed files with 44 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
@using Front.Services
@using Shared.DTOs
@inject HttpClientController hc;
<ConfirmDialog @ref="dialog" />
<form>
@* alert *@
<div class="row">
@@ -113,7 +114,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)
@@ -135,7 +136,7 @@ else
[Parameter] public RCustomer Cus { get; set; }
public int? ItemSearchCustomertype { get; set; }
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
private ConfirmDialog dialog = default!;
public ActionInResultComponent result { get; set; }
protected override async Task OnParametersSetAsync()
{
@@ -267,4 +268,20 @@ else
}
}
private async Task ShowConfirmationDeleteAsync()
{
if (Cus.ID.HasValue && Cus.ID.Value > 0)
{
var confirmation = await dialog.ShowAsync(
title: "عملیات حذف مشتری",
message1: $"از حذف مشتری {Cus.FullName}",
message2: "اطمینان دارید?");
if (confirmation)
await OnClickDelete();
}
}
}