47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
@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);
|
|
}
|
|
} |