This commit is contained in:
mmrbnjd
2024-05-07 13:55:11 +03:30
parent 85d9dfe849
commit 91fcef70d7
7 changed files with 153 additions and 29 deletions

View File

@@ -0,0 +1,47 @@
@using Shared.DTOs
<p>سلام</p>
@if (Cus.ID==-1)
{
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
جدید
</Button>
}
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>
}
@code {
[Parameter] public RCustomer Cus { get; set; }
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
public ActionInResultComponent result { get; set; }
protected override Task OnParametersSetAsync()
{
return base.OnParametersSetAsync();
}
}
@functions{
public async Task OnClickDelete(){
result.Action = ComponentAction.delete;
await OnMultipleOfThree.InvokeAsync(result);
}
public async Task OnClickUpdate()
{
result.Action = ComponentAction.update;
await OnMultipleOfThree.InvokeAsync(result);
}
public async Task OnClickAdd()
{
result.Action = ComponentAction.add;
await OnMultipleOfThree.InvokeAsync(result);
}
}