diff --git a/StandManager/Components/Pages/Registrazione.razor b/StandManager/Components/Pages/Registrazione.razor index d71cb65..814c69a 100644 --- a/StandManager/Components/Pages/Registrazione.razor +++ b/StandManager/Components/Pages/Registrazione.razor @@ -38,7 +38,7 @@ private bool showCodiceCliente { get; set; } = false; private bool showForm { get; set; } = false; private InvitoEventoViewModel invito { get; set; } = new InvitoEventoViewModel(); - private Component_Registrazione registrazione { get; set; } + private Component_Registrazione registrazione { get; set; } = new(); private string codiceFornito { get; set; } diff --git a/StandManager/Components/Pages/ScanNew.razor b/StandManager/Components/Pages/ScanNew.razor index a75a6c0..782a883 100644 --- a/StandManager/Components/Pages/ScanNew.razor +++ b/StandManager/Components/Pages/ScanNew.razor @@ -1,9 +1,13 @@ @page "/activate-qr-scan" @using StandManager.Components.Layout @inject NavigationManager Nav - @layout PublicLayout +@inject IJSRuntime JS +@inject BodyClassService BodyClass +@rendermode InteractiveServer + +Scan Code
@@ -14,7 +18,7 @@ class="btn btn-icon btn-ghost-secondary rounded-circle" aria-label="Chiudi" @onclick="OnClose"> - +
@@ -23,51 +27,79 @@ class="btn btn-icon btn-ghost-secondary rounded-circle" aria-label="Aiuto" @onclick="OnHelp"> - +
- -
-
-
- + @if (openManual) + { +
+
+
+ + @if (!string.IsNullOrEmpty(invalidCode)) + { +
@invalidCode
+ } +
+
+ +
+
+ +
+
+
+ } - - - - - + + @if (!openManual && !openScan) + { + +
+
+
+ + + + + + + +
+
+ +
+

Scan QR Code

+

+ Align the QR code within the frame to automatically detect and identify the client. +

-
-

Scan QR Code

-

- Align the QR code within the frame to automatically detect and identify the client. -

+
+
+ + + +
+ +
-
- - -
-
- - - -
- -
-
+ }
@@ -79,26 +111,46 @@ [Parameter] public EventCallback Scan { get; set; } [Parameter] public EventCallback Manual { get; set; } + private bool openManual { get; set; } = false; + private bool openScan { get; set; } = false; + private string registrationCode { get; set; } + private string invalidCode = string.Empty; + private async Task OnClose() { - if (Close.HasDelegate) await Close.InvokeAsync(); - else Nav.NavigateTo("/"); + Nav.NavigateTo("/"); } private async Task OnHelp() { - if (Help.HasDelegate) await Help.InvokeAsync(); } private async Task OnScan() { - if (Scan.HasDelegate) await Scan.InvokeAsync(); - // qui poi ci attacchi la logica di attivazione camera/scan + } private async Task OnManual() { - if (Manual.HasDelegate) await Manual.InvokeAsync(); - // es: Nav.NavigateTo("/enter-code"); + openManual = true; + } + + private async Task GoTo() + { + var code = Guid.Empty; + + if (Guid.TryParse(registrationCode, out code)) + { + var iscrizione = await _managerService.IscrizioneEventoService.RicercaPer(filtro: x => x.Id == code); + + var ok = await _dialogService.Confirm($"Il numero di persone indicate per questo evento è {iscrizione.Partecipanti}", $"Benvenuto {iscrizione.RagioneSociale}", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" }); + } + else invalidCode = "Il codice inserito non risulta corretto!"; + } + + private async Task UndoChoice() + { + openManual = false; + openScan = false; } }