50 lines
1.5 KiB
Plaintext
50 lines
1.5 KiB
Plaintext
|
|
@using Common.Dtos.Exper
|
|
@using HushianWebApp.Service
|
|
@using HushianWebApp.Services
|
|
@using Common.Validation
|
|
@inject UserService userService;
|
|
|
|
<div class="row" style="height: fit-content; padding: 1rem;">
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
<input dir="ltr" style="text-align:center;margin-bottom:10px" @bind-value="@model.FullName" type="text" class="form-control" placeholder="نام و نام خانوادگی" />
|
|
</div>
|
|
|
|
<Button Loading=loading LoadingText="در حال ویرایش اطلاعات..." Color="ButtonColor.Warning" @onclick="NewItem"> ویرایش </Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
@code {
|
|
[Inject] protected ToastService ToastService { get; set; } = default!;
|
|
[Parameter] public Update_ExperDto model { get; set; }
|
|
[Parameter] public int ExperID { get; set; }
|
|
[Parameter] public EventCallback OnMultipleOfThree { get; set; }
|
|
public bool loading { get; set; } = false;
|
|
}
|
|
@functions{
|
|
async Task NewItem()
|
|
{
|
|
if (!string.IsNullOrEmpty(model.FullName))
|
|
{
|
|
if (!model.FullName.IsOnlyPersianLetters())
|
|
{
|
|
ToastService.Notify(new(ToastType.Danger, $"نام و نام خانوادگی را به صورت فارسی مشخص کنید"));
|
|
return ;
|
|
}
|
|
loading = true;
|
|
if (await userService.ExperEditingFromManager(ExperID,model))
|
|
{
|
|
loading = false;
|
|
await OnMultipleOfThree.InvokeAsync();
|
|
}
|
|
loading = false;
|
|
}
|
|
}
|
|
|
|
|
|
} |