This commit is contained in:
2026-01-26 09:25:29 +01:00
parent 36dc2ad664
commit d5570c50cb
7 changed files with 103 additions and 8 deletions

View File

@ -131,7 +131,8 @@
<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* (<a href="https://www.gruppodac.eu/tutela-e-privacy/" target="_blank">leggi</a>)
Autorizzazione al trattamento dati*<br/>
I dati forniti saranno utilizzati esclusivamente per linvio del biglietto. (<a href="https://www.gruppodac.eu/tutela-e-privacy/" target="_blank">leggi</a>)
</label>
</div>
</div>
@ -151,6 +152,8 @@
[Parameter] public InvitoEventoViewModel invito { get; set; }
[Parameter] public bool hasCliente { get; set; }
[Parameter] public Func<object?, IscrizioneEvento, Task>? OnSubmitCompletedAsync { get; set; }
[SupplyParameterFromForm]
private IscrizioneEventoViewModel iscrizione { get; set; } = new();
private IEnumerable<DestinazioneViewModel> destinazioniList { get; set; }
@ -210,8 +213,11 @@
model = iscrizione.Map(model);
await _managerService.IscrizioneEventoService.Salva(model);
var saved = await _managerService.IscrizioneEventoService.Salva(model);
if (OnSubmitCompletedAsync is not null)
{
await OnSubmitCompletedAsync(this, saved);
}
_navManager.NavigateTo($"/Grazie");
}

View File

@ -81,11 +81,11 @@
includi: x => x.Include(i => i.Destinazioni).Include(y => y.Agente).Include(z => z.Capoarea),
solaLettura: false) ?? new Cliente();
clienteDb = await mapCliente(clienteDb, righeCliente, capoareaList, idClaim);
var codiceCapoarea = righeCliente.FirstOrDefault().CapoArea;
var codiceAgente = righeCliente.FirstOrDefault().Agente;
clienteDb.CapoareaId = (await _managerService.UtenteService.RicercaPer(x => x.CodiceAgente == codiceCapoarea))?.Id;
clienteDb.AgenteId = (await _managerService.UtenteService.RicercaPer(x => x.CodiceAgente == codiceAgente))?.Id;
clienteDb = await mapCliente(clienteDb, righeCliente, capoareaList, idClaim);
await _managerService.ClienteService.Salva(clienteDb, idClaim);
counter += 1;
StateHasChanged();

View File

@ -1,6 +1,5 @@
@using StandManager.Components.Layout
@using StandManager.Components.Widget
@using StandManager.Model
@page "/"
@page "/Registrazione"
@ -91,7 +90,8 @@
Body = string.Empty,
Sent = false,
Subject = "Registrazione",
DataCreazione = DateTime.Now
DataCreazione = DateTime.Now,
Args = "Social"
};
await _managerService.MailQueueService.Salva(queue);

View File

@ -1,9 +1,9 @@
@using Microsoft.EntityFrameworkCore
@using StandManager.Components.Layout
@using System.Threading.Tasks
@using StandManager.Model
@attribute [Authorize]
@page "/RegistrazioneInFiera"
@page "/registrazioneInFiera"
@layout PublicLayout
@rendermode InteractiveServer

View File

@ -0,0 +1,83 @@
@using Microsoft.EntityFrameworkCore
@using StandManager.Components.Layout
@using StandManager.Model
@page "/registrazione-campagna-socialmedia-dac-expo-tecnocom-2026"
@layout PublicLayout
@rendermode InteractiveServer
<PageTitle>Iscrizione Evento</PageTitle>
<AppHeader ShowNavigation="false"/>
<div class="container my-5 py-3">
<Component_Registrazione
invito="invito"
hasCliente="hasCliente"
@ref="registrazione"
OnSubmitCompletedAsync="@((sender, model) => onSubmitCompleted(model))"/>
</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 bool hasCliente { get; set; }
private string codiceFornito { get; set; }
private void onClienteToggleChanged(bool value)
{
if (!value)
{
hasCliente = false;
registrazione.NoCliente();
}
else
{
hasCliente = true;
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;
}
private async Task onSubmitCompleted(IscrizioneEvento model)
{
var queue = new MailQueue()
{
ToList = model.Email ?? string.Empty,
From = MailFrom.Registrazione,
Body = string.Empty,
Sent = false,
Subject = "Registrazione",
DataCreazione = DateTime.Now
};
await _managerService.MailQueueService.Salva(queue);
}
}