@@ -100,25 +100,18 @@
@functions{
private async Task newTicket(){
- // var request = await _hc.PostAsJsonAsync("Ticket/NewTicketNoAuthentication", model);
- // if (request.IsSuccessStatusCode)
- // {
- // messageStore?.Clear();
- // var res = await request.Content.ReadFromJsonAsync
();
- Verification pa = new Verification();
- pa.model = new VerificationCodeDto
- {
- prm =" Ticket.ID.ToString()",
- val = "item.Mobile",
- Type = "NewTicketNoAuthentication"
- };
- await Task.Run(()=>pa);
- // }
- // else
- // {
- // var error = await request.Content.ReadFromJsonAsync>();
- // messageStore?.Add(() => model.Mobile, error);
+ var request = await _hc.PostAsJsonAsync("Ticket/NewTicketNoAuthentication", model);
+ if (request.IsSuccessStatusCode)
+ {
+ messageStore?.Clear();
+ var res = await request.Content.ReadFromJsonAsync();
+ nav.NavigateTo($"Verification/{res}");
+ }
+ else
+ {
+ var error = await request.Content.ReadFromJsonAsync>();
+ messageStore?.Add(() => model.Mobile, error);
- // }
+ }
}
}
diff --git a/TaxPayerFull/Pages/Verification.razor b/TaxPayerFull/Pages/Verification.razor
index cd02456..99d514c 100644
--- a/TaxPayerFull/Pages/Verification.razor
+++ b/TaxPayerFull/Pages/Verification.razor
@@ -1,13 +1,101 @@
@using Shared.DTOs
-@page "/Verification/{model}"
-Verification
+@page "/Verification/{ID:int}"
+
+
+
+
+
+
@code {
[Parameter]
- public VerificationCodeDto? model { get; set; }
+ public int ID { get; set; }
+
+ [SupplyParameterFromForm]
+ public int Code { get; set; }
+
+ public VerificationCodeDto Model { get; set; }
protected override async Task OnParametersSetAsync()
{
- var dfsf = model;
await base.OnParametersSetAsync();
}
}
+@functions{
+
+ private void Submit()
+ {
+
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TaxPayerFull/Program.cs b/TaxPayerFull/Program.cs
index 27ef188..44acca9 100644
--- a/TaxPayerFull/Program.cs
+++ b/TaxPayerFull/Program.cs
@@ -7,9 +7,9 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("#app");
builder.RootComponents.Add("head::after");
-//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");