();
- OnShowModalClick();
- // nav.NavigateTo($"Verification/{res}");
+ nav.NavigateTo($"Verification/{res}");
}
else
{
@@ -137,28 +119,8 @@
}
}
- private async Task testhand()
- {
- ShowMessage(ToastType.Warning);
- }
- private async Task OnShowModalClick()
- {
- await _modal.ShowAsync();
- }
- private async Task OnHideModalClick()
- {
- await _modal.HideAsync();
- }
- private void ShowMessage(ToastType toastType) => messages.Add(CreateToastMessage(toastType));
- private ToastMessage CreateToastMessage(ToastType toastType)
- => new ToastMessage
- {
- Type = toastType,
- Title = "Blazor Bootstrap",
- HelpText = $"{DateTime.Now}",
- Message = $"Hello, world! This is a toast message. DateTime: {DateTime.Now}",
- };
+
}
diff --git a/TaxPayerFull/Pages/Verification.razor b/TaxPayerFull/Pages/Verification.razor
index b1d5816..d1aec77 100644
--- a/TaxPayerFull/Pages/Verification.razor
+++ b/TaxPayerFull/Pages/Verification.razor
@@ -42,7 +42,6 @@
- @* *@
@@ -70,7 +69,8 @@
- کد ارسال نشد؟ ارسال مجدد
+ کد ارسال نشد؟ ارسال مجدد
+
@@ -81,7 +81,7 @@
@code {
-
+ bool successfull = false;
// alert
AlertColor alertColor = AlertColor.Primary;
IconName alertIconName = IconName.CheckCircleFill;
@@ -95,7 +95,6 @@
[SupplyParameterFromForm]
public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto();
-
protected override async Task OnParametersSetAsync()
{
var request = await _hc.GetAsync($"Verification/GetVerification/{ID}");
@@ -114,6 +113,21 @@
}
@functions {
+ private async Task ReSend()
+ {
+
+ var request = await _hc.GetAsync($"Verification/ReSend/{VerificationCodeModel?.ID}");
+ if (request.IsSuccessStatusCode)
+ {
+ ShowSuccessAlert("کد مجدد ارسال شد");
+ }
+ else
+ {
+ ShowDangerAlert(await request.Content.ReadFromJsonAsync());
+ }
+
+
+ }
private async Task SubmitVerificationCode()
{
if (VerificationCodeModel.Code < 1000 || VerificationCodeModel.Code > 9000)
@@ -129,6 +143,7 @@
if (status)
{
ShowSuccessAlert("عملیات با موفقیت انجام شد");
+ successfull = true;
}
else
{
@@ -157,5 +172,11 @@
alertIconName = IconName.ExclamationTriangleFill;
alertMessage = msg;
}
- private async Task EndForm() => nav.NavigateTo("/");
+ private async Task EndForm()
+ {
+ if (!successfull)
+ await _hc.DeleteAsync($"Verification/Remove/{VerificationCodeModel?.ID}");
+
+ nav.NavigateTo("/");
+ }
}
diff --git a/TaxPayerFull/Program.cs b/TaxPayerFull/Program.cs
index 0d7c9f3..a4dafa0 100644
--- a/TaxPayerFull/Program.cs
+++ b/TaxPayerFull/Program.cs
@@ -9,9 +9,9 @@ builder.RootComponents.Add("head::after");
builder.Services.AddBlazorBootstrap();
-//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
+builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
-builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
+//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");