...
This commit is contained in:
@@ -12,12 +12,16 @@
|
||||
<span class="text-muted fw-light">متفرقه /</span> پروفایل
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||
@alertMessage
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -36,7 +40,7 @@
|
||||
<label for="upload" class="btn btn-primary me-2 mb-4" tabindex="0">
|
||||
<span class="d-none d-sm-block">آپلود تصویر جدید</span>
|
||||
<i class="bx bx-upload d-block d-sm-none"></i>
|
||||
<InputFile OnChange="changePic" type="file" id="upload" class="account-file-input" hidden="" accept="image/png, image/jpeg"/>
|
||||
<InputFile OnChange="changePic" type="file" id="upload" class="account-file-input" hidden="" accept="image/png, image/jpeg"/>
|
||||
</label>
|
||||
|
||||
<p class="text-muted mb-0">JPG، GIF یا PNG مجاز است. حداکثر اندازه @maxFileSize هزار</p>
|
||||
@@ -70,7 +74,7 @@
|
||||
<InputText @bind-Value="@changepassModel.renewPass" style="text-align:center;" class="form-control" type="password" id="html5-password-input3" />
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">ارسال</button>
|
||||
<Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary">ارسال</Button>
|
||||
</EditForm>
|
||||
|
||||
</div>
|
||||
@@ -88,7 +92,7 @@
|
||||
<span id="basic-icon-default-phone2" class="input-group-text"><i class="bx bx-phone"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">ارسال</button>
|
||||
<Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary">ارسال</Button>
|
||||
</EditForm>
|
||||
|
||||
</div>
|
||||
@@ -108,7 +112,7 @@
|
||||
<InputText @bind-Value="@newname" style="text-align:right;" type="text" id="basic-icon-default-company" class="form-control" placeholder="@userinfo.Company.Name" aria-label="@userinfo.Company.Name" aria-describedby="basic-icon-default-company2"/>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">ارسال</button>
|
||||
<Button Disabled="SpinnerVisible" Type="ButtonType.Submit" Color="ButtonColor.Primary">ارسال</Button>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
@@ -120,6 +124,7 @@
|
||||
|
||||
|
||||
@code {
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
[Parameter]
|
||||
public string from { get; set; } = "";
|
||||
|
||||
@@ -168,6 +173,7 @@
|
||||
alertMessage = msg;
|
||||
}
|
||||
private async Task changepassSubmit(){
|
||||
SpinnerVisible = true;
|
||||
var request = await _hc.Post<ChangePasswordDto>("User/ChangePassword", changepassModel);
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -184,9 +190,11 @@
|
||||
var errors = await request.Content.ReadFromJsonAsync<List<string>>();
|
||||
ShowDangerAlert(errors[0]);
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task changeUserNameSubmit()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
if (newUsername != userinfo.UserName)
|
||||
{
|
||||
var request = await _hc.Get($"User/ChangeUserName/{newUsername}");
|
||||
@@ -203,10 +211,11 @@
|
||||
ShowDangerAlert(errors[0]);
|
||||
}
|
||||
}
|
||||
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task changeNameSubmit()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
if (newname != userinfo.Company.Name)
|
||||
{
|
||||
var request = await _hc.Get($"Company/ChangeName/{newname}");
|
||||
@@ -231,9 +240,10 @@
|
||||
ShowDangerAlert(errors[0]);
|
||||
}
|
||||
}
|
||||
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private async Task changePic(InputFileChangeEventArgs e){
|
||||
SpinnerVisible = true;
|
||||
if (e.GetMultipleFiles()[0].Size <= maxFileSize)
|
||||
{
|
||||
string Base64Str = "";
|
||||
@@ -266,6 +276,7 @@
|
||||
{
|
||||
ShowDangerAlert ( "حجم فایل بیشتر از حد مجاز می باشد");
|
||||
}
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user