88 lines
3.0 KiB
Plaintext
88 lines
3.0 KiB
Plaintext
@using Microsoft.EntityFrameworkCore
|
|
@using StandManager.Components.Layout
|
|
@using System.Threading.Tasks
|
|
@using StandManager.Model
|
|
|
|
@page "/Registrazione"
|
|
@layout PublicLayout
|
|
|
|
@rendermode InteractiveServer
|
|
|
|
<PageTitle>Iscrizione Evento</PageTitle>
|
|
<header class="navbar navbar-expand-lg navbar-transparent bg-red py-3" data-bs-theme="dark">
|
|
<div class="container position-relative">
|
|
|
|
<img src="/Logo_dac.png" alt="Logo DAC" class="d-block mx-auto" style="height: 80px;" />
|
|
|
|
<div class="collapse navbar-collapse position-absolute end-0 top-50 translate-middle-y pe-3">
|
|
<nav class="navbar-nav ms-auto">
|
|
<div class="nav-item">
|
|
<a class="nav-link text-white" href="/management"><span class="nav-link-title">Management</span></a>
|
|
</div>
|
|
<div class="nav-item">
|
|
<a class="nav-link text-white" href="/scan"><span class="nav-link-title">Scansione</span></a>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<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>
|
|
|
|
<Footer />
|
|
|
|
@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; }
|
|
|
|
private string codiceFornito { get; set; }
|
|
|
|
private void onClienteToggleChanged(bool value)
|
|
{
|
|
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;
|
|
registrazione.SetDatiCliente();
|
|
}
|
|
|
|
showForm = true;
|
|
}
|
|
} |