Pagina iscrizione
This commit is contained in:
@ -41,5 +41,6 @@
|
||||
<script src="/Plugin/Select2/js/select2.full.min.js"></script>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
|
||||
<script src="/js/BodyClass.js"></script>
|
||||
<script src="/js/site.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -9,34 +9,42 @@
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<nav class="navbar-nav ms-auto mb-2 mb-lg-0 text-end pe-lg-4">
|
||||
@if (ShowNavigation)
|
||||
{
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<nav class="navbar-nav ms-auto mb-2 mb-lg-0 text-end pe-lg-4">
|
||||
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/management">
|
||||
<span class="nav-link-title">Management</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/management">
|
||||
<span class="nav-link-title">Management</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/scan">
|
||||
<span class="nav-link-title">Scansione</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/scan">
|
||||
<span class="nav-link-title">Scansione</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/registrazione">
|
||||
<span class="nav-link-title">Registrazione</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/registrazione">
|
||||
<span class="nav-link-title">Registrazione</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/activate-qr-scan">
|
||||
<span class="nav-link-title">ScanNew</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<a class="nav-link text-white px-3 fs-5" href="/activate-qr-scan">
|
||||
<span class="nav-link-title">ScanNew</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
@code {
|
||||
|
||||
[Parameter] public bool ShowNavigation { get; set; } = true;
|
||||
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<RadzenComponents @rendermode="InteractiveAuto" />
|
||||
@Body
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.4.0/dist/jsQR.js"></script>
|
||||
|
||||
@ -99,12 +99,6 @@
|
||||
</RadzenFormField>
|
||||
<ValidationMessage For="@(() => iscrizione.GiornoPresenza)" />
|
||||
</div>
|
||||
<div class="col-6 mb-3">
|
||||
<RadzenFormField Text="Numero di partecipanti" Variant="Variant.Flat" Style="width: 100%;">
|
||||
<RadzenNumeric ShowUpDown="false" TValue="int" TextAlign="TextAlign.Right" Style="width: 100%" aria-label="Partecipanti" @bind-Value="@iscrizione.Partecipanti" />
|
||||
</RadzenFormField>
|
||||
<ValidationMessage For="@(() => iscrizione.Partecipanti)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -208,11 +202,11 @@
|
||||
TipologiaClienteId = iscrizione.TipologiaClienteId
|
||||
};
|
||||
|
||||
if (invito.EventoId != Guid.Empty && iscrizione.DestinazioneId == Guid.Empty)
|
||||
/*if (invito.EventoId != Guid.Empty && iscrizione.DestinazioneId == Guid.Empty)
|
||||
{
|
||||
_dialogService.Alert("Selezionare una destinazione valida.", "Attenzione");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
model = iscrizione.Map(model);
|
||||
|
||||
@ -236,7 +230,7 @@
|
||||
|
||||
public void NoCliente()
|
||||
{
|
||||
destinazioniList = new List<DestinazioneViewModel>() { new DestinazioneViewModel() { RagioneSociale = "--Nessuna" } };
|
||||
destinazioniList = new List<DestinazioneViewModel>() { new() { RagioneSociale = "--Nessuna" } };
|
||||
hasCliente = false;
|
||||
iscrizione.EsperienzaConDAC = "No";
|
||||
}
|
||||
@ -249,7 +243,7 @@
|
||||
private async Task onProvinciaChanged(object args)
|
||||
{
|
||||
Guid parsed;
|
||||
var guidId = Guid.TryParse(args.ToString(), out parsed);
|
||||
Guid.TryParse(args.ToString(), out parsed);
|
||||
var prov = await _managerService.ProvinciaIstatService.RicercaPer(x => x.Id == parsed);
|
||||
|
||||
if (prov == null)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
@page "/Grazie"
|
||||
@using StandManager.Components.Layout
|
||||
@using StandManager.Components.Widget
|
||||
|
||||
@layout PublicLayout
|
||||
|
||||
@ -8,6 +9,7 @@
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Grazie</PageTitle>
|
||||
<AppHeader ShowNavigation="false" />
|
||||
|
||||
<div class="page page-center">
|
||||
<div class="container container-tight py-4">
|
||||
@ -22,9 +24,9 @@
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="mt-2">Ti aspettiamo!</h1>
|
||||
<h1 class="mt-2">Grazie</h1>
|
||||
<p class="text-secondary">
|
||||
Controlla la tua email per verificare di aver ricevuto il QR code di invito.
|
||||
Operazione completata. La tua richiesta di ingresso è stata inoltrata al team DAC. Riceverai presto il tuo invito.
|
||||
</p>
|
||||
</div>
|
||||
<div class="hr-text hr-text-center hr-text-spaceless"></div>
|
||||
@ -40,6 +42,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<ShareLink Messaggio="Invita anche i tuoi collaboratori a partecipare: condividi questo link e ricordati che la registrazione è obbligatoria per ottenere l’ingresso omaggio nominale."/>
|
||||
</div>
|
||||
|
||||
<DacFooter />
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--tblr-primary: #D63939;
|
||||
@ -55,6 +63,6 @@
|
||||
@code {
|
||||
private void goToHome()
|
||||
{
|
||||
_navManager.NavigateTo("/");
|
||||
_navManager.NavigateTo("/registrazione");
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Components.Layout
|
||||
@using System.Threading.Tasks
|
||||
@using StandManager.Components.Layout
|
||||
@using StandManager.Components.Widget
|
||||
@using StandManager.Model
|
||||
|
||||
@page "/Registrazione"
|
||||
@ -9,68 +8,86 @@
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Iscrizione Evento</PageTitle>
|
||||
<AppHeader />
|
||||
<AppHeader ShowNavigation="false" />
|
||||
<div class="container my-5 py-3">
|
||||
<ClienteToggle ValueChanged="onClienteToggleChanged" />
|
||||
@if (showCodiceCliente)
|
||||
{
|
||||
<EditForm Model="iscrizione" OnValidSubmit="OnIscrizioneSave" FormName="iscrizioneForm">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<RadzenFormField Text="Codice cliente o Partita IVA" Variant="Variant.Flat" Style="width: 100%;">
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Codice cliente o Partita IVA" Change="(args => onCodiceFornitoChanged(args))" />
|
||||
<div class="col-12 mb-3 text-center">
|
||||
<h1>Ricevi il tuo ingresso in fiera</h1>
|
||||
<p class="text-secondary fs-3 lh-3">
|
||||
Inserisci il tuo indirizzo email per richiedere il biglietto digitale.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-6 mb-3">
|
||||
<RadzenFormField Text="Email" Variant="Variant.Flat" Style="width: 100%;">
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" Placeholder="es. nome@azienda.com" @bind-Value="@iscrizione.Mail"/>
|
||||
</RadzenFormField>
|
||||
<ValidationMessage For="@(() => iscrizione.Mail)"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-6 mb-3">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<RadzenCheckBox class="form-check-input" @bind-Value="PresaVisionePrivacy" Name="presaVisionePrivacy" TValue="bool"/>
|
||||
<label class="rz-ms-2" for="presaVisionePrivacy" style="cursor: pointer;">
|
||||
Presa visione dell'informativa Privacy* (<a href="/" target="_blank">leggi</a>)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<RadzenCheckBox class="form-check-input" @bind-Value="PresaVisioneDatiPersonali" Name="presaVisioneDatiPersonali" TValue="bool"/>
|
||||
<label class="rz-ms-2" for="presaVisioneDatiPersonali" style="cursor: pointer;">
|
||||
Autorizzazione al trattamento dati*<br/>
|
||||
I dati forniti saranno utilizzati esclusivamente per l’invio del biglietto. (<a href="/" target="_blank">leggi</a>)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-6 mb-3">
|
||||
<button type="submit" class="btn btn-danger w-100" disabled="@(!PresaVisionePrivacy || !PresaVisioneDatiPersonali)">
|
||||
Invia richiesta
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (showForm)
|
||||
{
|
||||
<Component_Registrazione invito="invito" @ref="registrazione" />
|
||||
}
|
||||
</EditForm>
|
||||
|
||||
<ShareLink Messaggio="Condividi questo link con i collaboratori interessati a partecipare alla fiera: la registrazione è obbligatoria per ciascun partecipante al fine di ottenere l’ingresso omaggio nominale."/>
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
<DacFooter />
|
||||
|
||||
@code {
|
||||
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; } = new();
|
||||
private IscrizioneEventoPerMailViewModel iscrizione { get; set; } = new();
|
||||
|
||||
private bool PresaVisionePrivacy { get; set; }
|
||||
private bool PresaVisioneDatiPersonali { get; set; }
|
||||
|
||||
private string codiceFornito { get; set; }
|
||||
|
||||
private void onClienteToggleChanged(bool value)
|
||||
private async Task OnIscrizioneSave()
|
||||
{
|
||||
if (!value)
|
||||
registrazione.NoCliente();
|
||||
else
|
||||
registrazione.HasCliente();
|
||||
|
||||
showCodiceCliente = value;
|
||||
showForm = true;
|
||||
}
|
||||
|
||||
private async Task onCodiceFornitoChanged(string text)
|
||||
{
|
||||
codiceFornito = text;
|
||||
invito.CodiceFornito = codiceFornito;
|
||||
|
||||
var destinazione = (await _managerService.DestinazioneService.RicercaPer(
|
||||
x => x.PartitaIva == codiceFornito || x.CodiceFiscale == codiceFornito || x.Rid == codiceFornito || x.Cliente.Rid == codiceFornito,
|
||||
includi: x => x.Include(y => y.Cliente)));
|
||||
|
||||
if (destinazione != null)
|
||||
var exist = await _managerService.IscrizioneEventoPerMailService.RicercaPer(x => x.Mail == iscrizione.Mail && !x.Eliminato);
|
||||
if (exist != null && exist?.Id != Guid.Empty)
|
||||
{
|
||||
invito.ClienteId = destinazione.ClienteId;
|
||||
invito.DestinazioneId = destinazione.Id;
|
||||
invito.CodiceFornito = codiceFornito;
|
||||
invito.RagioneSociale = destinazione.Cliente?.RagioneSociale ?? string.Empty;
|
||||
await registrazione.SetDatiCliente();
|
||||
await _dialogService.Alert("L'indirizzo mail indicato è già stato utilizzato", "Errore", new ConfirmOptions() { OkButtonText = "Ok" });
|
||||
return;
|
||||
}
|
||||
|
||||
showForm = true;
|
||||
|
||||
var model = new IscrizioneEventoPerMail()
|
||||
{
|
||||
Mail = iscrizione.Mail
|
||||
};
|
||||
await _managerService.IscrizioneEventoPerMailService.Salva(model);
|
||||
_navManager.NavigateTo("/Grazie");
|
||||
}
|
||||
}
|
||||
76
StandManager/Components/Pages/RegistrazioneInFiera.razor
Normal file
76
StandManager/Components/Pages/RegistrazioneInFiera.razor
Normal file
@ -0,0 +1,76 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Components.Layout
|
||||
@using System.Threading.Tasks
|
||||
@using StandManager.Model
|
||||
|
||||
@page "/RegistrazioneInFiera"
|
||||
@layout PublicLayout
|
||||
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Iscrizione Evento</PageTitle>
|
||||
<AppHeader />
|
||||
<div class="container my-5 py-3">
|
||||
<ClienteToggle ValueChanged="onClienteToggleChanged" />
|
||||
@if (showCodiceCliente)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<RadzenFormField Text="Codice cliente o Partita IVA" Variant="Variant.Flat" Style="width: 100%;">
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Codice cliente o Partita IVA" Change="(args => onCodiceFornitoChanged(args))" />
|
||||
</RadzenFormField>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (showForm)
|
||||
{
|
||||
<Component_Registrazione invito="invito" @ref="registrazione" />
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<DacFooter />
|
||||
|
||||
@code {
|
||||
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; } = new();
|
||||
|
||||
private string codiceFornito { get; set; }
|
||||
|
||||
private void onClienteToggleChanged(bool value)
|
||||
{
|
||||
if (!value)
|
||||
registrazione.NoCliente();
|
||||
else
|
||||
registrazione.HasCliente();
|
||||
|
||||
showCodiceCliente = value;
|
||||
showForm = true;
|
||||
}
|
||||
|
||||
private async Task onCodiceFornitoChanged(string text)
|
||||
{
|
||||
codiceFornito = text;
|
||||
invito.CodiceFornito = codiceFornito;
|
||||
|
||||
var destinazione = (await _managerService.DestinazioneService.RicercaPer(
|
||||
x => x.PartitaIva == codiceFornito || x.CodiceFiscale == codiceFornito || x.Rid == codiceFornito || x.Cliente.Rid == codiceFornito,
|
||||
includi: x => x.Include(y => y.Cliente)));
|
||||
|
||||
if (destinazione != null)
|
||||
{
|
||||
invito.ClienteId = destinazione.ClienteId;
|
||||
invito.DestinazioneId = destinazione.Id;
|
||||
invito.CodiceFornito = codiceFornito;
|
||||
invito.RagioneSociale = destinazione.Cliente?.RagioneSociale ?? string.Empty;
|
||||
await registrazione.SetDatiCliente();
|
||||
}
|
||||
|
||||
showForm = true;
|
||||
}
|
||||
}
|
||||
@ -40,7 +40,7 @@
|
||||
<strong>Errore:</strong> @errorMessage
|
||||
</div>
|
||||
}
|
||||
<Footer />
|
||||
<DacFooter />
|
||||
@code {
|
||||
private ElementReference videoRef;
|
||||
private DotNetObjectReference<Scan>? objRef;
|
||||
|
||||
75
StandManager/Components/Widget/ShareLink.razor
Normal file
75
StandManager/Components/Widget/ShareLink.razor
Normal file
@ -0,0 +1,75 @@
|
||||
@inject IJSRuntime JS
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-4"></div>
|
||||
<div class="col-4 mb-3 text-center">
|
||||
<div class="card card-sm">
|
||||
<div class="card-body d-flex align-items-center gap-3">
|
||||
<div class="flex-fill">
|
||||
<div class="fw-bold">Condividi questo link</div>
|
||||
<div class="text-muted small">
|
||||
@Messaggio
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-icon @ButtonCss"
|
||||
title="@_label"
|
||||
disabled="@_copied"
|
||||
@onclick="CopyLink">
|
||||
@if (_copied)
|
||||
{
|
||||
<!-- check -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon"
|
||||
width="24" height="24" viewBox="0 0 24 24"
|
||||
stroke-width="2" stroke="currentColor"
|
||||
fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z"/>
|
||||
<path d="M5 12l5 5l10 -10"/>
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- share -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon"
|
||||
width="24" height="24" viewBox="0 0 24 24"
|
||||
stroke-width="2" stroke="currentColor"
|
||||
fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="6" cy="12" r="3"/>
|
||||
<circle cx="18" cy="6" r="3"/>
|
||||
<circle cx="18" cy="18" r="3"/>
|
||||
<path d="M8.7 10.7l6.6 -3.4"/>
|
||||
<path d="M8.7 13.3l6.6 3.4"/>
|
||||
</svg>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public string Messaggio { get; set; } = string.Empty;
|
||||
private string _label = "Copia link";
|
||||
private bool _copied;
|
||||
|
||||
private string ButtonCss =>
|
||||
_copied ? "btn-success" : "btn-outline-primary";
|
||||
|
||||
private async Task CopyLink()
|
||||
{
|
||||
await JS.InvokeVoidAsync(
|
||||
"navigator.clipboard.writeText",
|
||||
"https://registrazioni.gruppodac.eu:666/registrazione"
|
||||
);
|
||||
|
||||
_copied = true;
|
||||
StateHasChanged();
|
||||
|
||||
await Task.Delay(3000);
|
||||
|
||||
_copied = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
23
StandManager/Model/IscrizioneEventoPerMailViewModel.cs
Normal file
23
StandManager/Model/IscrizioneEventoPerMailViewModel.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Model;
|
||||
|
||||
public class IscrizioneEventoPerMailViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Mail { get; set; }
|
||||
public bool Processata { get; set; }
|
||||
public bool Inviata { get; set; }
|
||||
public static implicit operator IscrizioneEventoPerMailViewModel(IscrizioneEventoPerMail model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new IscrizioneEventoPerMailViewModel()
|
||||
{
|
||||
Mail = model.Mail,
|
||||
Id = model.Id,
|
||||
Inviata = model.Inviata,
|
||||
Processata = model.Processata
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,7 @@ public class IscrizioneEventoViewModel
|
||||
public ClienteViewModel Cliente { get; set; }
|
||||
public Guid? ClienteId { get; set; }
|
||||
public Guid? DestinazioneId { get; set; }
|
||||
[Range(1, int.MaxValue, ErrorMessage = "Inserire un numero di partecipanti valido")]
|
||||
/*[Range(1, int.MaxValue, ErrorMessage = "Inserire un numero di partecipanti valido")]*/
|
||||
public int Partecipanti { get; set; }
|
||||
|
||||
public string? Note { get; set; }
|
||||
@ -95,5 +95,4 @@ public class IscrizioneEventoViewModel
|
||||
GiornoPresenza = model.GiornoPresenza,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -145,4 +145,15 @@ function swalErrorMsg(msg) {
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
window.TablerToast = function (message) {
|
||||
if (window.Tabler?.toast) {
|
||||
Tabler.toast.show({
|
||||
message: message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
alert(message);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user