Utente/Eventi
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using StandManager.Domain.Entita.Base;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
@ -7,12 +8,12 @@ public class Cliente : EntitaBase
|
||||
{
|
||||
public string RagioneSociale { get; set; }
|
||||
public string PartitaIva { get; set; }
|
||||
public string Cap { get; set; }
|
||||
public string Citta { get; set; }
|
||||
public string Indirizzo { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string EmailInvito { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public string? Cap { get; set; }
|
||||
public string? Citta { get; set; }
|
||||
public string? Indirizzo { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? EmailInvito { get; set; }
|
||||
public string? NumeroTelefono { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Agente))]
|
||||
public Guid? AgenteId { get; set; }
|
||||
@ -21,12 +22,14 @@ public class Cliente : EntitaBase
|
||||
[InverseProperty(nameof(Destinazione.Cliente))]
|
||||
public List<Destinazione> Destinazioni { get; set; }
|
||||
|
||||
public string Rid { get; set; }
|
||||
public string? Rid { get; set; }
|
||||
public ClienteTipo TipologiaCliente { get; set; }
|
||||
}
|
||||
|
||||
public enum ClienteTipo
|
||||
{
|
||||
[Description("Cliente")]
|
||||
Cliente = 0,
|
||||
[Description("Potenziale cliente")]
|
||||
Lead = 99
|
||||
}
|
||||
|
||||
@ -6,16 +6,16 @@ namespace StandManager.Domain.Entita;
|
||||
public class Destinazione : EntitaBase
|
||||
{
|
||||
[ForeignKey(nameof(Cliente))]
|
||||
public Guid? Clienteid { get; set; }
|
||||
public Guid? ClienteId { get; set; }
|
||||
public Cliente Cliente { get; set; }
|
||||
public string RagioneSociale { get; set; }
|
||||
public string PartitaIva { get; set; }
|
||||
public string Cap { get; set; }
|
||||
public string Citta { get; set; }
|
||||
public string Indirizzo { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string EmailInvito { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public string? Cap { get; set; }
|
||||
public string? Citta { get; set; }
|
||||
public string? Indirizzo { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? EmailInvito { get; set; }
|
||||
public string? NumeroTelefono { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Agente))]
|
||||
public Guid? AgenteId { get; set; }
|
||||
|
||||
@ -11,4 +11,7 @@ public class Evento : EntitaBase
|
||||
public string TemplateHtmlMailIscrizione { get; set; }
|
||||
public DateTime DataDa { get; set; }
|
||||
public DateTime DataA { get; set; }
|
||||
|
||||
public DateTime IscrizioneDa { get; set; }
|
||||
public DateTime IscrizioneA { get; set; }
|
||||
}
|
||||
|
||||
615
StandManager.Infrastructure/Migrations/20251203092034_CampiNullableCliente.Designer.cs
generated
Normal file
615
StandManager.Infrastructure/Migrations/20251203092034_CampiNullableCliente.Designer.cs
generated
Normal file
@ -0,0 +1,615 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using StandManager.Infrastructure.DAL.Context;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(StandManagerDbContext))]
|
||||
[Migration("20251203092034_CampiNullableCliente")]
|
||||
partial class CampiNullableCliente
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Rid")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TipologiaCliente")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Cliente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("Clienteid")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("Clienteid");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Destinazione");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataA")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataDa")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Luogo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailIscrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Titolo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Evento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("InvitoEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataScan")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("InvitoEventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Partecipanti")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("QrCodeCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("ScanCompleto")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("InvitoEventoId");
|
||||
|
||||
b.ToTable("IscrizioneEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Ruolo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RuoloNote")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Referente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Utente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany("Destinazioni")
|
||||
.HasForeignKey("Clienteid");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.InvitoEvento", "InvitoEvento")
|
||||
.WithMany()
|
||||
.HasForeignKey("InvitoEventoId");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("InvitoEvento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany("Referenti")
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Navigation("Destinazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Navigation("Referenti");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,144 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CampiNullableCliente : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Rid",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "NumeroTelefono",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Indirizzo",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "EmailInvito",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Citta",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Cap",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Rid",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "NumeroTelefono",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Indirizzo",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "EmailInvito",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Citta",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Cap",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
609
StandManager.Infrastructure/Migrations/20251203100107_CampiNullableDestinazione.Designer.cs
generated
Normal file
609
StandManager.Infrastructure/Migrations/20251203100107_CampiNullableDestinazione.Designer.cs
generated
Normal file
@ -0,0 +1,609 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using StandManager.Infrastructure.DAL.Context;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(StandManagerDbContext))]
|
||||
[Migration("20251203100107_CampiNullableDestinazione")]
|
||||
partial class CampiNullableDestinazione
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Rid")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TipologiaCliente")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Cliente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("Clienteid")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("Clienteid");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Destinazione");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataA")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataDa")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Luogo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailIscrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Titolo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Evento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("InvitoEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataScan")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("InvitoEventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Partecipanti")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("QrCodeCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("ScanCompleto")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("InvitoEventoId");
|
||||
|
||||
b.ToTable("IscrizioneEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Ruolo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RuoloNote")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Referente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Utente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany("Destinazioni")
|
||||
.HasForeignKey("Clienteid");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.InvitoEvento", "InvitoEvento")
|
||||
.WithMany()
|
||||
.HasForeignKey("InvitoEventoId");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("InvitoEvento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany("Referenti")
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Navigation("Destinazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Navigation("Referenti");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class CampiNullableDestinazione : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "NumeroTelefono",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Indirizzo",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "EmailInvito",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Citta",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Cap",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "NumeroTelefono",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Indirizzo",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "EmailInvito",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Email",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Citta",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Cap",
|
||||
table: "Destinazione",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
615
StandManager.Infrastructure/Migrations/20251203160222_DateIscrizioneEvento.Designer.cs
generated
Normal file
615
StandManager.Infrastructure/Migrations/20251203160222_DateIscrizioneEvento.Designer.cs
generated
Normal file
@ -0,0 +1,615 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using StandManager.Infrastructure.DAL.Context;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(StandManagerDbContext))]
|
||||
[Migration("20251203160222_DateIscrizioneEvento")]
|
||||
partial class DateIscrizioneEvento
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Rid")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TipologiaCliente")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Cliente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("AgenteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RagioneSociale")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Destinazione");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataA")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("DataDa")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Descrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("IscrizioneA")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("IscrizioneDa")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Luogo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TemplateHtmlMailIscrizione")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Titolo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Evento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("InvitoEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataScan")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("EventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("InvitoEventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Partecipanti")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("QrCodeCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("ScanCompleto")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("EventoId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("InvitoEventoId");
|
||||
|
||||
b.ToTable("IscrizioneEvento");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DestinazioneId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Ruolo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RuoloNote")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DestinazioneId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Referente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cognome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DataModifica")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<bool>("Eliminato")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Nome")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Username")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.ToTable("Utente");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "Agente")
|
||||
.WithMany()
|
||||
.HasForeignKey("AgenteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany("Destinazioni")
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Agente");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.IscrizioneEvento", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||
.WithMany()
|
||||
.HasForeignKey("EventoId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.InvitoEvento", "InvitoEvento")
|
||||
.WithMany()
|
||||
.HasForeignKey("InvitoEventoId");
|
||||
|
||||
b.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
b.Navigation("InvitoEvento");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Referente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Destinazione", "Destinazione")
|
||||
.WithMany("Referenti")
|
||||
.HasForeignKey("DestinazioneId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Utente", b =>
|
||||
{
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteCreazione");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteModifica")
|
||||
.WithMany()
|
||||
.HasForeignKey("IdUtenteModifica");
|
||||
|
||||
b.Navigation("UtenteCreazione");
|
||||
|
||||
b.Navigation("UtenteModifica");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Cliente", b =>
|
||||
{
|
||||
b.Navigation("Destinazioni");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("StandManager.Domain.Entita.Destinazione", b =>
|
||||
{
|
||||
b.Navigation("Referenti");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DateIscrizioneEvento : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Destinazione_Cliente_Clienteid",
|
||||
table: "Destinazione");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Clienteid",
|
||||
table: "Destinazione",
|
||||
newName: "ClienteId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Destinazione_Clienteid",
|
||||
table: "Destinazione",
|
||||
newName: "IX_Destinazione_ClienteId");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "IscrizioneA",
|
||||
table: "Evento",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "IscrizioneDa",
|
||||
table: "Evento",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Destinazione_Cliente_ClienteId",
|
||||
table: "Destinazione",
|
||||
column: "ClienteId",
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Destinazione_Cliente_ClienteId",
|
||||
table: "Destinazione");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IscrizioneA",
|
||||
table: "Evento");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IscrizioneDa",
|
||||
table: "Evento");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ClienteId",
|
||||
table: "Destinazione",
|
||||
newName: "Clienteid");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Destinazione_ClienteId",
|
||||
table: "Destinazione",
|
||||
newName: "IX_Destinazione_Clienteid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Destinazione_Cliente_Clienteid",
|
||||
table: "Destinazione",
|
||||
column: "Clienteid",
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,11 +32,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
@ -49,11 +47,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
@ -63,11 +59,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
@ -79,7 +73,6 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Rid")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TipologiaCliente")
|
||||
@ -106,14 +99,12 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Cap")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("Clienteid")
|
||||
b.Property<Guid?>("ClienteId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DataCreazione")
|
||||
@ -126,11 +117,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EmailInvito")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("IdUtenteCreazione")
|
||||
@ -140,11 +129,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Indirizzo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NumeroTelefono")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PartitaIva")
|
||||
@ -159,7 +146,7 @@ namespace StandManager.Infrastructure.Migrations
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
|
||||
b.HasIndex("Clienteid");
|
||||
b.HasIndex("ClienteId");
|
||||
|
||||
b.HasIndex("IdUtenteCreazione");
|
||||
|
||||
@ -199,6 +186,12 @@ namespace StandManager.Infrastructure.Migrations
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("IscrizioneA")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("IscrizioneDa")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Luogo")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@ -468,7 +461,7 @@ namespace StandManager.Infrastructure.Migrations
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Cliente", "Cliente")
|
||||
.WithMany("Destinazioni")
|
||||
.HasForeignKey("Clienteid");
|
||||
.HasForeignKey("ClienteId");
|
||||
|
||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||
.WithMany()
|
||||
|
||||
23
StandManager/Components/Layout/LoginLayout.razor
Normal file
23
StandManager/Components/Layout/LoginLayout.razor
Normal file
@ -0,0 +1,23 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<link href="/lib/tabler/tabler.min.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-flags.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-socials.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-payments.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-vendors.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-marketing.css" rel="stylesheet" />
|
||||
<link href="/css/tabler-themes.css" rel="stylesheet" />
|
||||
|
||||
<link href="/libs/Fontawesome/css/all.min.css" rel="stylesheet" />
|
||||
<link href="/libs/Fontawesome/css/regular.min.css" rel="stylesheet" />
|
||||
<body class="body-marketing body-gradient">
|
||||
@Body
|
||||
</body>
|
||||
|
||||
<script src="/lib/jquery/dist/jquery.js" asp-append-version="true"></script>
|
||||
<script src="/lib/tabler/tabler.min.js" asp-append-version="true"></script>
|
||||
<script src="/libs/FontAwesome/js/all.min.js" asp-append-version="true"></script>
|
||||
<script src="/libs/FontAwesome/js/fontawesome.min.js" asp-append-version="true"></script>
|
||||
<script src="/lib/sweetalert/sweetalert2.all.min.js" asp-append-version="true"></script>
|
||||
<script src="/js/site.js" type="text/javascript" asp-append-version="true"></script>
|
||||
<script src="/Plugin/Select2/js/select2.full.min.js"></script>
|
||||
1
StandManager/Components/Layout/LoginLayout.razor.css
Normal file
1
StandManager/Components/Layout/LoginLayout.razor.css
Normal file
@ -0,0 +1 @@
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
@using Microsoft.AspNetCore.Authentication
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
<RadzenComponents @rendermode="InteractiveAuto" />
|
||||
|
||||
<div class="page">
|
||||
<!-- NAV MENU MANAGEMENT -->
|
||||
<header class="navbar navbar-expand-md d-print-none" >
|
||||
@ -66,6 +68,14 @@
|
||||
<span class="nav-link-title"> Clienti </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/management/Eventi">
|
||||
<span class="nav-link-icon d-md-none d-lg-inline-block">
|
||||
<i class="fa-solid fa-address-card"></i>
|
||||
</span>
|
||||
<span class="nav-link-title"> Eventi </span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -76,12 +86,15 @@
|
||||
</div>
|
||||
|
||||
@Body
|
||||
@code {
|
||||
[CascadingParameter] public HttpContext httpContext { get; set; } = default;
|
||||
|
||||
private async Task OnLogoutPressed(MouseEventArgs e)
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
public HttpContext? httpContext { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var a = "Ciao";
|
||||
@* await httpContext.SignOutAsync(); *@
|
||||
base.OnInitializedAsync();
|
||||
|
||||
var context = httpContext.GetRouteData();
|
||||
}
|
||||
}
|
||||
8
StandManager/Components/Layout/ManagementLayout.razor
Normal file
8
StandManager/Components/Layout/ManagementLayout.razor
Normal file
@ -0,0 +1,8 @@
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@inherits LayoutComponentBase
|
||||
@attribute [Authorize]
|
||||
|
||||
<div class="page">
|
||||
<NavMenuManagement/>
|
||||
@Body
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
|
||||
70
StandManager/Components/Layout/NavMenuManagement.razor
Normal file
70
StandManager/Components/Layout/NavMenuManagement.razor
Normal file
@ -0,0 +1,70 @@
|
||||
@using Microsoft.AspNetCore.Authentication
|
||||
<header class="navbar navbar-expand-md d-print-none" >
|
||||
<div class="container-xl">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
|
||||
<a href="/management">
|
||||
<img src="/Logo_dac.png" width="80" class="">
|
||||
</a>
|
||||
</h1>
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<div class="navbar-nav flex-row order-md-last">
|
||||
<div class="nav-item dropdown">
|
||||
<a href="#" class="nav-link d-flex lh-1 text-reset p-0" data-bs-toggle="dropdown" aria-label="Open user menu">
|
||||
<span class="avatar avatar-sm" style="background-image: url('/Logo_dac.png')"></span>
|
||||
<div class="d-none d-xl-block ps-2">
|
||||
<div>@context.User.Identity?.Name</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
|
||||
<a href="/management/profile" class="dropdown-item">Il mio profilo</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a @onclick:preventDefault @onclick="OnLogoutPressed" class="dropdown-item">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</div>
|
||||
</header>
|
||||
<header class="navbar-expand-md">
|
||||
<div class="collapse navbar-collapse" id="navbar-menu">
|
||||
<div class="navbar">
|
||||
<div class="container-xl">
|
||||
<div class="row flex-column flex-md-row flex-fill align-items-center">
|
||||
<div class="col">
|
||||
<!-- BEGIN NAVBAR MENU -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/management">
|
||||
<span class="nav-link-icon d-md-none d-lg-inline-block">
|
||||
<i class="fa-solid fa-house"></i>
|
||||
</span>
|
||||
<span class="nav-link-title"> Home </span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var a = "";
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
||||
[CascadingParameter] public HttpContext httpContext { get; set; } = default;
|
||||
|
||||
private async Task OnLogoutPressed()
|
||||
{
|
||||
await httpContext.SignOutAsync();
|
||||
}
|
||||
}
|
||||
125
StandManager/Components/Layout/NavMenuManagement.razor.css
Normal file
125
StandManager/Components/Layout/NavMenuManagement.razor.css
Normal file
@ -0,0 +1,125 @@
|
||||
.navbar-toggler {
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
width: 3.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 1rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.navbar-toggler:checked {
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.top-row {
|
||||
height: 3.5rem;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.bi {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
margin-right: 0.75rem;
|
||||
top: -1px;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.bi-house-door-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-plus-square-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-list-nested-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-lock-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-person-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-person' viewBox='0 0 16 16'%3E%3Cpath d='M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-person-badge-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-person-badge' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3zM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z'/%3E%3Cpath d='M4.5 0A2.5 2.5 0 0 0 2 2.5V14a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2.5A2.5 2.5 0 0 0 11.5 0h-7zM3 2.5A1.5 1.5 0 0 1 4.5 1h7A1.5 1.5 0 0 1 13 2.5v10.795a4.2 4.2 0 0 0-.776-.492C11.392 12.387 10.063 12 8 12s-3.392.387-4.224.803a4.2 4.2 0 0 0-.776.492V2.5z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-person-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-person-fill' viewBox='0 0 16 16'%3E%3Cpath d='M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.bi-arrow-bar-left-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-arrow-bar-left' viewBox='0 0 16 16'%3E%3Cpath d='M12.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5ZM10 8a.5.5 0 0 1-.5.5H3.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L3.707 7.5H9.5a.5.5 0 0 1 .5.5Z'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link {
|
||||
color: #d7d7d7;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.37);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-toggler:checked ~ .nav-scrollable {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
|
||||
/* Allow sidebar to scroll for tall menus */
|
||||
height: calc(100vh - 3.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
@ -60,6 +60,10 @@
|
||||
|
||||
protected override void OnInitialized() => model ??= new();
|
||||
|
||||
/// <summary>
|
||||
/// Gestisce il login: controlla le credenziali, crea i claim dell’utente,
|
||||
/// esegue il sign-in con cookie e reindirizza all’area management.
|
||||
/// </summary>
|
||||
private async Task HandleValidSubmit(EditContext args)
|
||||
{
|
||||
var user = await _managerService.UtenteService.RicercaPer(x => x.Email == model.Email);
|
||||
@ -83,6 +87,6 @@
|
||||
var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
var principal = new ClaimsPrincipal(identity);
|
||||
await httpContext.SignInAsync(principal);
|
||||
_navManager.NavigateTo("/management/dashboard");
|
||||
_navManager.NavigateTo("/management");
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,9 @@
|
||||
[CascadingParameter]
|
||||
public HttpContext? httpContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Effettua il logout dell’utente e lo reindirizza alla homepage.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await httpContext.SignOutAsync();
|
||||
|
||||
13
StandManager/Components/Pages/Auth.razor
Normal file
13
StandManager/Components/Pages/Auth.razor
Normal file
@ -0,0 +1,13 @@
|
||||
@page "/auth"
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>Auth</PageTitle>
|
||||
|
||||
<h1>You are authenticated</h1>
|
||||
|
||||
<AuthorizeView>
|
||||
Hello @context.User.Identity?.Name!
|
||||
</AuthorizeView>
|
||||
19
StandManager/Components/Pages/Counter.razor
Normal file
19
StandManager/Components/Pages/Counter.razor
Normal file
@ -0,0 +1,19 @@
|
||||
@page "/counter"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Counter</PageTitle>
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
||||
<p role="status">Current count: @currentCount</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
@attribute [Authorize]
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Model
|
||||
|
||||
<EditForm Model="destinazione" OnValidSubmit="onDestinazioneSave" FormName="editeditClienteDestinazioneForm">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Ragione Sociale</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@destinazione.RagioneSociale" />
|
||||
<ValidationMessage For="@(() => destinazione.RagioneSociale)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Partita Iva</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@destinazione.PartitaIva" />
|
||||
<ValidationMessage For="@(() => destinazione.PartitaIva)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.Email" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Numero di Telefono</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.NumeroTelefono" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Cap</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@destinazione.Cap" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Citta</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@destinazione.Citta" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Indirizzo</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.Indirizzo" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email di invito</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.EmailInvito" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Agente</RadzenText>
|
||||
<RadzenDropDown Style="width: 100%" TValue="Guid?" @bind-Value=@destinazione.AgenteId Data=@agenti TextProperty="Info" ValueProperty="Id" Name="agenteDestDrop" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<button type="button" class="btn btn-default w-100" @onclick="dismissModal">
|
||||
Annulla
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-3 mb-3">
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
Salva
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
|
||||
@code {
|
||||
[Parameter] public Guid destinazioneId { get; set; } = Guid.Empty;
|
||||
[Parameter] public Guid clienteId { get; set; } = Guid.Empty;
|
||||
private DestinazioneViewModel destinazione { get; set; } = new();
|
||||
|
||||
private IEnumerable<UtenteViewModel> agenti { get; set; } = new List<UtenteViewModel>();
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza il componente caricando l’elenco degli agenti non eliminati
|
||||
/// ordinati per cognome e nome, e recupera (o crea) la destinazione associata
|
||||
/// in base al parametro <c>destinazioneId</c>.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
base.OnInitializedAsync();
|
||||
|
||||
agenti = (await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome)))
|
||||
.Select(x => (UtenteViewModel)x).ToList();
|
||||
|
||||
destinazione = destinazioneId == Guid.Empty ? new() : await _managerService.DestinazioneService.RicercaPer(x => x.Id == destinazioneId,
|
||||
includi: x => x.Include(y =>y.Agente));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva la destinazione: recupera o crea il record, aggiorna i dati dalla UI,
|
||||
/// collega l’agente scelto e registra tutto usando l’ID dell’utente corrente.
|
||||
/// </summary>
|
||||
private async Task onDestinazioneSave()
|
||||
{
|
||||
var idClaim = await MembershipUtils.GetUserId(_auth);
|
||||
|
||||
var model = await _managerService.DestinazioneService.RicercaPer(x => x.Id == destinazione.Id, solaLettura: false)
|
||||
?? new Destinazione() { ClienteId = clienteId };
|
||||
model = destinazione.Map(model);
|
||||
|
||||
if (destinazione.AgenteId.GetValueOrDefault() != Guid.Empty)
|
||||
model.Agente = await _managerService.UtenteService.RicercaPer(x => x.Id == destinazione.AgenteId);
|
||||
|
||||
await _managerService.DestinazioneService.Salva(model, idClaim);
|
||||
_dialogService.Close(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiude il modal senza fare ulteriori azioni.
|
||||
/// </summary>
|
||||
private void dismissModal()
|
||||
{
|
||||
_dialogService.Close(true);
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
<a href="/management/Utenti/Modifica" class="btn btn-primary btn-5 d-none d-sm-inline-block">
|
||||
<a href="/management/Clienti/Modifica" class="btn btn-primary btn-5 d-none d-sm-inline-block">
|
||||
Nuovo cliente
|
||||
</a>
|
||||
</div>
|
||||
@ -31,14 +31,14 @@
|
||||
<div class="table-responsive">
|
||||
<RadzenDataGrid @ref="clientiGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="5"
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@clienti" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
Data="@clienti" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.Id)" Filterable="false" Title="ID" Width="80px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.RagioneSociale)" Title="Ragione sociale" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.PartitaIva)" Title="Partita IVA" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.Agente)" Title="Agente" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.RagioneSociale)" Title="Ragione sociale" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.PartitaIva)" Title="Partita IVA" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(ClienteViewModel.NomeAgente)" Title="Agente" Width="250px" />
|
||||
|
||||
<RadzenDataGridColumn Context="order" Filterable="false" Sortable="false" TextAlign="TextAlign.Right">
|
||||
<RadzenDataGridColumn Context="cliente" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
||||
<Template Context="cliente">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="rz-my-1 rz-ms-1" Click="@(args => EditRow(cliente))" @onclick:stopPropagation="true" />
|
||||
<RadzenButton Icon="delete" ButtonStyle="ButtonStyle.Danger" Variant="Variant.Flat" Size="ButtonSize.Medium" Shade="Shade.Lighter" class="rz-my-1 rz-ms-1" Click="@(args => DeleteRow(cliente))" @onclick:stopPropagation="true" />
|
||||
@ -58,6 +58,10 @@
|
||||
List<ClienteViewModel> clienti;
|
||||
RadzenDataGrid<ClienteViewModel> clientiGrid;
|
||||
|
||||
/// <summary>
|
||||
/// Carica l’elenco dei clienti non eliminati, includendo l’agente,
|
||||
/// e prepara i dati per la visualizzazione in pagina.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
@ -66,11 +70,18 @@
|
||||
.Select(x => (ClienteViewModel)x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apre la pagina di modifica per il cliente selezionato.
|
||||
/// </summary>
|
||||
private async Task EditRow(ClienteViewModel cliente)
|
||||
{
|
||||
_navManager.NavigateTo($"/management/Clienti/Modifica/{cliente.Id}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiede conferma ed elimina il cliente scelto; se confermato,
|
||||
/// aggiorna la lista ricaricandola dal database.
|
||||
/// </summary>
|
||||
private async Task DeleteRow(ClienteViewModel cliente)
|
||||
{
|
||||
var ok = await _dialogService.Confirm($"Vuoi davvero eliminare il cliente {cliente.RagioneSociale}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||
|
||||
281
StandManager/Components/Pages/Management/Clienti_Edit.razor
Normal file
281
StandManager/Components/Pages/Management/Clienti_Edit.razor
Normal file
@ -0,0 +1,281 @@
|
||||
@attribute [Authorize]
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@page "/management/Clienti/Modifica"
|
||||
@page "/management/Clienti/Modifica/{ClienteId:guid}"
|
||||
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Model
|
||||
|
||||
@inject AuthenticationStateProvider auth
|
||||
|
||||
<PageTitle>@pageTitle</PageTitle>
|
||||
|
||||
<div class="page-wrapper">
|
||||
<!-- BEGIN PAGE HEADER -->
|
||||
<div class="page-header d-print-none" aria-label="Page header">
|
||||
<div class="container-xl">
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col">
|
||||
<h2 class="page-title">@pageTitle</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE HEADER -->
|
||||
<!-- BEGIN PAGE BODY -->
|
||||
<div class="page-body">
|
||||
<div class="container-xl">
|
||||
<div class="row row-cards">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Anagrafica
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-5">
|
||||
<EditForm Model="cliente" OnValidSubmit="onClienteSave" FormName="editClienteForm">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Ragione Sociale</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@cliente.RagioneSociale" />
|
||||
<ValidationMessage For="@(() => cliente.RagioneSociale)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Partita Iva</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@cliente.PartitaIva" />
|
||||
<ValidationMessage For="@(() => cliente.PartitaIva)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@cliente.Email" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Numero di Telefono</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@cliente.NumeroTelefono" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Cap</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@cliente.Cap" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Citta</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@cliente.Citta" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Indirizzo</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@cliente.Indirizzo" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email di invito</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@cliente.EmailInvito" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Agente</RadzenText>
|
||||
<RadzenDropDown Style="width: 100%" TValue="Guid?" @bind-Value=@cliente.AgenteId Data=@agenti TextProperty="Info" ValueProperty="Id" Name="agenteDrop" />
|
||||
</div>
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Tipologia</RadzenText>
|
||||
<RadzenDropDown Style="width: 100%" TValue="int" @bind-Value=@cliente.TipologiaClienteInt Data=@tipologiaCliente TextProperty="Description" ValueProperty="Key" Name="tipologiaClienteDrop" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<button type="button" class="btn btn-default w-100" @onclick="backToHome">
|
||||
Annulla
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-3 mb-3">
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
Salva
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (cliente.Id != Guid.Empty)
|
||||
{
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Destinazioni
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-5">
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
<RadzenButton ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => onNuovaDestinazionePressed())" @onclick:stopPropagation="true" Text="Nuova destinazione"></RadzenButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<RadzenDataGrid @ref="destinazioniGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="5"
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@cliente.Destinazioni" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.Id)" Filterable="false" Title="ID" Width="80px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.RagioneSociale)" Title="Ragione sociale" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.PartitaIva)" Title="Partita IVA" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.Cap)" Title="Cap" Width="100px" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.Citta)" Title="Citta" Width="150px" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.Indirizzo)" Title="Indirizzo" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(DestinazioneViewModel.NomeAgente)" Title="Agente" Width="200px" />
|
||||
|
||||
<RadzenDataGridColumn Context="destinazione" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="200px">
|
||||
<Template Context="destinazione">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="rz-my-1 rz-ms-1" Click="@(args => EditDestinazione(destinazione))" @onclick:stopPropagation="true" />
|
||||
<RadzenButton Icon="delete" ButtonStyle="ButtonStyle.Danger" Variant="Variant.Flat" Size="ButtonSize.Medium" Shade="Shade.Lighter" class="rz-my-1 rz-ms-1" Click="@(args => DeleteDestinazione(destinazione))" @onclick:stopPropagation="true" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Guid? ClienteId { get; set; }
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private ClienteViewModel cliente { get; set; } = new();
|
||||
|
||||
private IEnumerable<UtenteViewModel> agenti { get; set; } = new List<UtenteViewModel>();
|
||||
private List<LookupViewModel<int>> tipologiaCliente { get; set; } = new List<LookupViewModel<int>>();
|
||||
RadzenDataGrid<DestinazioneViewModel> destinazioniGrid;
|
||||
|
||||
private string pageTitle => cliente?.Id == Guid.Empty ? "Nuovo cliente" : "Modifica cliente";
|
||||
|
||||
private DialogOptions editNewDialogOption { get; set; } = new DialogOptions()
|
||||
{
|
||||
Resizable = false,
|
||||
Draggable = false,
|
||||
Width = "700px"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza la pagina: carica gli agenti, le tipologie cliente
|
||||
/// e, se presente l’ID, recupera il cliente con agente e destinazioni,
|
||||
/// registrando anche l’evento di chiusura del dialog.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
agenti = (await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome)))
|
||||
.Select(x => (UtenteViewModel)x).ToList();
|
||||
var eUtils = new EnumUtils();
|
||||
tipologiaCliente = eUtils.GetEnumList<ClienteTipo>();
|
||||
|
||||
if (ClienteId.GetValueOrDefault() != Guid.Empty)
|
||||
cliente = await _managerService.ClienteService.RicercaPer(x => x.Id == ClienteId, includi: x => x.Include(y => y.Agente).Include(y => y.Destinazioni).ThenInclude(z => z.Agente));
|
||||
else
|
||||
cliente = new ClienteViewModel();
|
||||
|
||||
_dialogService.OnClose += onDialogClose;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alla chiusura del dialog ricarica da database le destinazioni
|
||||
/// del cliente aggiornando la lista in schermata.
|
||||
/// </summary>
|
||||
private async void onDialogClose(dynamic result)
|
||||
{
|
||||
cliente.Destinazioni = (await _managerService.DestinazioneService.RicercaQueryable(x => x.Eliminato == false && x.ClienteId == cliente.Id, includi: x => x.Include(y => y.Agente)))
|
||||
.Select(x => (DestinazioneViewModel)x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva il cliente: recupera o crea il modello, applica i dati dalla UI,
|
||||
/// collega l’agente, crea una destinazione di default se è un nuovo cliente
|
||||
/// e poi salva usando l’ID dell’utente loggato, tornando alla lista clienti.
|
||||
/// </summary>
|
||||
private async Task onClienteSave()
|
||||
{
|
||||
var idClaim = await MembershipUtils.GetUserId(auth);
|
||||
|
||||
var model = await _managerService.ClienteService.RicercaPer(x => x.Id == cliente.Id, solaLettura: false)
|
||||
?? new Cliente() { Destinazioni = new List<Destinazione>() };
|
||||
|
||||
model = cliente.Map(model);
|
||||
if (cliente.AgenteId.GetValueOrDefault() != Guid.Empty)
|
||||
model.Agente = await _managerService.UtenteService.RicercaPer(x => x.Id == cliente.AgenteId);
|
||||
|
||||
if (cliente.Id == Guid.Empty)
|
||||
{
|
||||
var destinazione = new Destinazione() { Cliente = model };
|
||||
destinazione = cliente.GetDestinazione(destinazione);
|
||||
model.Destinazioni.Add(destinazione);
|
||||
}
|
||||
|
||||
await _managerService.ClienteService.Salva(model, idClaim);
|
||||
_navManager.NavigateTo("/management/Clienti");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Torna alla pagina di elenco clienti senza salvare altre modifiche.
|
||||
/// </summary>
|
||||
private void backToHome()
|
||||
{
|
||||
_navManager.NavigateTo("/management/Clienti");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apre il dialog di modifica per la destinazione selezionata.
|
||||
/// </summary>
|
||||
private async Task EditDestinazione(DestinazioneViewModel destinazione)
|
||||
{
|
||||
await _dialogService.OpenAsync<Cliente_Destinazione>($"Destinazione {destinazione.RagioneSociale}", new Dictionary<string, object>() { { "destinazioneId", destinazione.Id }, { "clienteId", cliente.Id } }, editNewDialogOption);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apre il dialog per creare una nuova destinazione collegata al cliente.
|
||||
/// </summary>
|
||||
private async Task onNuovaDestinazionePressed()
|
||||
{
|
||||
await _dialogService.OpenAsync<Cliente_Destinazione>($"Nuova destinazione", new Dictionary<string, object>() { { "clienteId", cliente.Id } }, editNewDialogOption);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiede conferma, elimina la destinazione scelta se confermato
|
||||
/// e ricarica l’elenco delle destinazioni del cliente.
|
||||
/// </summary>
|
||||
private async Task DeleteDestinazione(DestinazioneViewModel destinazione)
|
||||
{
|
||||
var ok = await _dialogService.Confirm($"Vuoi davvero eliminare la destinazione {cliente.RagioneSociale}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||
|
||||
if (ok == true)
|
||||
{
|
||||
await _managerService.DestinazioneService.Elimina(destinazione.Id, await MembershipUtils.GetUserId(auth));
|
||||
cliente.Destinazioni = (await _managerService.DestinazioneService.RicercaQueryable(x => x.Eliminato == false && x.ClienteId == cliente.Id, includi: x => x.Include(y => y.Agente)))
|
||||
.Select(x => (DestinazioneViewModel)x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
80
StandManager/Components/Pages/Management/Eventi.razor
Normal file
80
StandManager/Components/Pages/Management/Eventi.razor
Normal file
@ -0,0 +1,80 @@
|
||||
@attribute [Authorize]
|
||||
@page "/management/Eventi"
|
||||
@using StandManager.Model
|
||||
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Eventi</PageTitle>
|
||||
|
||||
<div class="page-wrapper">
|
||||
<!-- BEGIN PAGE BODY -->
|
||||
<div class="page-body">
|
||||
<div class="container-xl">
|
||||
<div class="row row-cards">
|
||||
<div class="col">
|
||||
<!-- Page pre-title -->
|
||||
<div class="page-pretitle">Overview</div>
|
||||
<h2 class="page-title">Eventi</h2>
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
<a href="/management/Eventi/Modifica" class="btn btn-primary btn-5 d-none d-sm-inline-block">
|
||||
Nuovo evento
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<RadzenDataGrid @ref="eventiGrid" AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true" PageSize="5"
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@eventi" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.Titolo)" Title="Titolo" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataDa)" Title="Dal" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataA)" Title="Al" Width="250px" />
|
||||
|
||||
<RadzenDataGridColumn Context="evento" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
||||
<Template Context="evento">
|
||||
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="rz-my-1 rz-ms-1" Click="@(args => EditRow(evento))" @onclick:stopPropagation="true" />
|
||||
<RadzenButton Icon="delete" ButtonStyle="ButtonStyle.Danger" Variant="Variant.Flat" Size="ButtonSize.Medium" Shade="Shade.Lighter" class="rz-my-1 rz-ms-1" Click="@(args => DeleteRow(evento))" @onclick:stopPropagation="true" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
List<EventoViewModel> eventi;
|
||||
RadzenDataGrid<EventoViewModel> eventiGrid;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
eventi = (await _managerService.EventoService.RicercaQueryable(x => x.Eliminato == false)).Select(x => (EventoViewModel)x).ToList();
|
||||
}
|
||||
|
||||
private async Task EditRow(EventoViewModel evento)
|
||||
{
|
||||
_navManager.NavigateTo($"/management/Eventi/Modifica/{evento.Id}");
|
||||
}
|
||||
|
||||
private async Task DeleteRow(EventoViewModel evento)
|
||||
{
|
||||
var ok = await _dialogService.Confirm($"Vuoi davvero eliminare l'evento {evento.Titolo}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||
|
||||
if (ok == true)
|
||||
{
|
||||
await _managerService.EventoService.Elimina(evento.Id, await MembershipUtils.GetUserId(_auth));
|
||||
eventi = (await _managerService.EventoService.RicercaQueryable(x => x.Eliminato == false)).Select(x => (EventoViewModel)x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
158
StandManager/Components/Pages/Management/Eventi_Edit.razor
Normal file
158
StandManager/Components/Pages/Management/Eventi_Edit.razor
Normal file
@ -0,0 +1,158 @@
|
||||
@attribute [Authorize]
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@page "/management/Eventi/Modifica"
|
||||
@page "/management/Eventi/Modifica/{EventoId:guid}"
|
||||
@using StandManager.Model
|
||||
|
||||
<PageTitle>@pageTitle</PageTitle>
|
||||
|
||||
<div class="page-wrapper">
|
||||
<!-- BEGIN PAGE HEADER -->
|
||||
<div class="page-header d-print-none" aria-label="Page header">
|
||||
<div class="container-xl">
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col">
|
||||
<h2 class="page-title">@pageTitle</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE HEADER -->
|
||||
<!-- BEGIN PAGE BODY -->
|
||||
<div class="page-body">
|
||||
<div class="container-xl">
|
||||
<div class="row row-cards">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row g-5">
|
||||
<EditForm Model="evento" OnValidSubmit="onEventoSave" FormName="editUserForm">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Titolo</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@evento.Titolo" />
|
||||
<ValidationMessage For="@(() => evento.Titolo)" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data Da</RadzenText>
|
||||
<RadzenDatePicker Style="width: 100%" aria-label="DataDa" @bind-Value="@evento.DataDa" ShowTime="false" DateFormat="dd/MM/yyyy" />
|
||||
<ValidationMessage For="@(() => evento.DataDa)" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data A</RadzenText>
|
||||
<RadzenDatePicker Style="width: 100%" aria-label="DataA" @bind-Value="@evento.DataA" ShowTime="false" DateFormat="dd/MM/yyyy" />
|
||||
<ValidationMessage For="@(() => evento.DataA)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Luogo</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Luogo" @bind-Value="@evento.Luogo" />
|
||||
<ValidationMessage For="@(() => evento.Luogo)" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data Iscrizione Da</RadzenText>
|
||||
<RadzenDatePicker Style="width: 100%" aria-label="DataDa" @bind-Value="@evento.IscrizioneDa" ShowTime="false" DateFormat="dd/MM/yyyy" />
|
||||
<ValidationMessage For="@(() => evento.IscrizioneDa)" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Data Iscrizione A</RadzenText>
|
||||
<RadzenDatePicker Style="width: 100%" aria-label="DataA" @bind-Value="@evento.IscrizioneA" ShowTime="false" DateFormat="dd/MM/yyyy" />
|
||||
<ValidationMessage For="@(() => evento.IscrizioneA)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Descrizione</RadzenText>
|
||||
<RadzenTextArea @bind-Value="@evento.Descrizione" Style="width: 100%" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Template mail invito</RadzenText>
|
||||
<RadzenHtmlEditor @bind-Value="@evento.TemplateHtmlMailInvito" Style="width: 100%; height: 450px;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Template mail iscrizione</RadzenText>
|
||||
<RadzenHtmlEditor @bind-Value="@evento.TemplateHtmlMailIscrizione" Style="width: 100%; height: 450px;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<button type="button" class="btn btn-default w-100" @onclick="backToHome">
|
||||
Annulla
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-3 mb-3">
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
Salva
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Guid? EventoId { get; set; }
|
||||
|
||||
[SupplyParameterFromForm]
|
||||
private EventoViewModel? evento { get; set; } = new();
|
||||
|
||||
private string pageTitle => evento?.Id == Guid.Empty ? "Nuovo evento" : "Modifica evento";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (EventoId.GetValueOrDefault() != Guid.Empty)
|
||||
evento = await _managerService.EventoService.RicercaPer(x => x.Id == EventoId);
|
||||
else
|
||||
evento = new EventoViewModel(){DataDa = DateTime.Now, DataA = DateTime.Now, IscrizioneDa = DateTime.Now, IscrizioneA = DateTime.Now};
|
||||
}
|
||||
|
||||
private async Task onEventoSave()
|
||||
{
|
||||
var idClaim = await MembershipUtils.GetUserId(_auth);
|
||||
|
||||
var model = await _managerService.EventoService.RicercaPer(x => x.Id == evento.Id, solaLettura: false) ?? new Evento();
|
||||
model = evento.Map(model);
|
||||
await _managerService.EventoService.Salva(model, idClaim);
|
||||
|
||||
_navManager.NavigateTo("/management/Eventi");
|
||||
}
|
||||
|
||||
private void backToHome()
|
||||
{
|
||||
_navManager.NavigateTo("/management/Eventi");
|
||||
}
|
||||
}
|
||||
@ -56,18 +56,28 @@
|
||||
IQueryable<Utente> utenti;
|
||||
RadzenDataGrid<Utente> userGrid;
|
||||
|
||||
/// <summary>
|
||||
/// Carica la lista degli utenti non eliminati, ordinandoli per cognome e nome.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
utenti = await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false);
|
||||
utenti = await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apre la pagina di modifica dell’utente selezionato.
|
||||
/// </summary>
|
||||
private async Task EditRow(Utente user)
|
||||
{
|
||||
_navManager.NavigateTo($"/management/Utenti/Modifica/{user.Id}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiede conferma ed elimina l’utente; se confermato, aggiorna la lista
|
||||
/// ricaricandola dal database.
|
||||
/// </summary>
|
||||
private async Task DeleteRow(Utente user)
|
||||
{
|
||||
var ok = await _dialogService.Confirm($"Vuoi davvero eliminare l'utente {user.ToString()}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||
|
||||
@ -90,6 +90,10 @@
|
||||
|
||||
private string pageTitle => utente?.Id == Guid.Empty ? "Nuovo utente" : "Modifica utente";
|
||||
|
||||
/// <summary>
|
||||
/// Recupera l’utente da modificare se è stato passato un ID,
|
||||
/// altrimenti inizializza un nuovo modello vuoto.
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (UserId.GetValueOrDefault() != Guid.Empty)
|
||||
@ -98,6 +102,11 @@
|
||||
utente = new UtenteViewModel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva l’utente: recupera o crea il modello, applica le modifiche dalla UI,
|
||||
/// gestisce l’hash della password se inserita e registra tutto a database
|
||||
/// usando l’ID dell’utente autenticato.
|
||||
/// </summary>
|
||||
private async Task onUtenteSave()
|
||||
{
|
||||
var state = await auth.GetAuthenticationStateAsync();
|
||||
@ -123,6 +132,9 @@
|
||||
_navManager.NavigateTo("/management/Utenti");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Torna all’elenco utenti senza applicare altre azioni.
|
||||
/// </summary>
|
||||
private void backToHome()
|
||||
{
|
||||
_navManager.NavigateTo("/management/Utenti");
|
||||
|
||||
64
StandManager/Components/Pages/Weather.razor
Normal file
64
StandManager/Components/Pages/Weather.razor
Normal file
@ -0,0 +1,64 @@
|
||||
@page "/weather"
|
||||
@attribute [StreamRendering]
|
||||
|
||||
<PageTitle>Weather</PageTitle>
|
||||
|
||||
<h1>Weather</h1>
|
||||
|
||||
<p>This component demonstrates showing data.</p>
|
||||
|
||||
@if (forecasts == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Temp. (C)</th>
|
||||
<th>Temp. (F)</th>
|
||||
<th>Summary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var forecast in forecasts)
|
||||
{
|
||||
<tr>
|
||||
<td>@forecast.Date.ToShortDateString()</td>
|
||||
<td>@forecast.TemperatureC</td>
|
||||
<td>@forecast.TemperatureF</td>
|
||||
<td>@forecast.Summary</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@code {
|
||||
private WeatherForecast[]? forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// Simulate asynchronous loading to demonstrate streaming rendering
|
||||
await Task.Delay(500);
|
||||
|
||||
var startDate = DateOnly.FromDateTime(DateTime.Now);
|
||||
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
|
||||
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = startDate.AddDays(index),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
Summary = summaries[Random.Shared.Next(summaries.Length)]
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
private class WeatherForecast
|
||||
{
|
||||
public DateOnly Date { get; set; }
|
||||
public int TemperatureC { get; set; }
|
||||
public string? Summary { get; set; }
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
}
|
||||
}
|
||||
@ -21,3 +21,4 @@
|
||||
|
||||
@inject DialogService _dialogService
|
||||
@inject NavigationManager _navManager
|
||||
@inject AuthenticationStateProvider _auth
|
||||
@ -1,11 +1,13 @@
|
||||
using StandManager.Domain.Entita;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StandManager.Model
|
||||
{
|
||||
namespace StandManager.Model;
|
||||
public class ClienteViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[Required(ErrorMessage ="La ragione sociale è obbligatoria")]
|
||||
public string RagioneSociale { get; set; }
|
||||
[Required(ErrorMessage = "La Partita IVA")]
|
||||
public string PartitaIva { get; set; }
|
||||
public string Cap { get; set; }
|
||||
public string Citta { get; set; }
|
||||
@ -13,12 +15,14 @@ namespace StandManager.Model
|
||||
public string Email { get; set; }
|
||||
public string EmailInvito { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public string Agente { get; set; }
|
||||
public string NomeAgente { get; set; }
|
||||
public Guid? AgenteId { get; set; }
|
||||
public List<Destinazione> Destinazioni { get; set; }
|
||||
public UtenteViewModel Agente { get; set; }
|
||||
public List<DestinazioneViewModel> Destinazioni { get; set; }
|
||||
|
||||
public string Rid { get; set; }
|
||||
public ClienteTipo TipologiaCliente { get; set; }
|
||||
public int TipologiaClienteInt { get; set; }
|
||||
|
||||
public static implicit operator ClienteViewModel(Cliente model)
|
||||
{
|
||||
@ -26,21 +30,52 @@ namespace StandManager.Model
|
||||
? null
|
||||
: new ClienteViewModel()
|
||||
{
|
||||
Agente = model.Agente?.ToString(),
|
||||
NomeAgente = model.Agente?.ToString(),
|
||||
Agente = model.Agente,
|
||||
AgenteId = model.AgenteId,
|
||||
Cap = model.Cap,
|
||||
Citta = model.Citta,
|
||||
Email = model.Email,
|
||||
EmailInvito = model.EmailInvito,
|
||||
Id = model.Id,
|
||||
Destinazioni = model.Destinazioni,
|
||||
Destinazioni = model.Destinazioni?.Where(x => x.Eliminato == false).Select(x => (DestinazioneViewModel)x).ToList() ?? new List<DestinazioneViewModel>(),
|
||||
Indirizzo = model.Indirizzo,
|
||||
NumeroTelefono = model.NumeroTelefono,
|
||||
PartitaIva = model.PartitaIva,
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
Rid = model.Rid,
|
||||
TipologiaCliente = model.TipologiaCliente
|
||||
TipologiaCliente = model.TipologiaCliente,
|
||||
TipologiaClienteInt = (int)model.TipologiaCliente
|
||||
};
|
||||
}
|
||||
|
||||
public Cliente Map(Cliente model)
|
||||
{
|
||||
model.RagioneSociale = RagioneSociale;
|
||||
model.PartitaIva = PartitaIva;
|
||||
model.Cap = Cap;
|
||||
model.Citta = Citta;
|
||||
model.Indirizzo = Indirizzo;
|
||||
model.Email = Email;
|
||||
model.EmailInvito = EmailInvito;
|
||||
model.NumeroTelefono = NumeroTelefono;
|
||||
model.Rid = Rid;
|
||||
model.TipologiaCliente = TipologiaCliente;
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public Destinazione GetDestinazione(Destinazione model)
|
||||
{
|
||||
model.RagioneSociale = RagioneSociale;
|
||||
model.PartitaIva = PartitaIva;
|
||||
model.Cap = Cap;
|
||||
model.Citta = Citta;
|
||||
model.Indirizzo = Indirizzo;
|
||||
model.Email = Email;
|
||||
model.EmailInvito = EmailInvito;
|
||||
model.NumeroTelefono = NumeroTelefono;
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
59
StandManager/Model/DestinazioneViewModel.cs
Normal file
59
StandManager/Model/DestinazioneViewModel.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using StandManager.Domain.Entita;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace StandManager.Model;
|
||||
public class DestinazioneViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[Required(ErrorMessage = "La ragione sociale è obbligatoria")]
|
||||
public string RagioneSociale { get; set; }
|
||||
[Required(ErrorMessage = "La Partita IVA")]
|
||||
public string PartitaIva { get; set; }
|
||||
public string Cap { get; set; }
|
||||
public string Citta { get; set; }
|
||||
public string Indirizzo { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string EmailInvito { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public Guid? AgenteId { get; set; }
|
||||
public string NomeAgente { get; set; }
|
||||
public UtenteViewModel Agente { get; set; }
|
||||
public List<ReferenteViewModel> Referenti { get; set; }
|
||||
|
||||
public static implicit operator DestinazioneViewModel(Destinazione model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new DestinazioneViewModel()
|
||||
{
|
||||
NomeAgente = model.Agente?.ToString(),
|
||||
Agente = model.Agente,
|
||||
AgenteId = model.Agente?.Id,
|
||||
Cap = model.Cap,
|
||||
Citta = model.Citta,
|
||||
Email = model.Email,
|
||||
EmailInvito = model.EmailInvito,
|
||||
Id = model.Id,
|
||||
Indirizzo = model.Indirizzo,
|
||||
NumeroTelefono = model.NumeroTelefono,
|
||||
PartitaIva = model.PartitaIva,
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
Referenti = model.Referenti?.Select(x => (ReferenteViewModel)x).ToList() ?? new List<ReferenteViewModel>()
|
||||
};
|
||||
}
|
||||
|
||||
public Destinazione Map(Destinazione model)
|
||||
{
|
||||
model.RagioneSociale = RagioneSociale;
|
||||
model.PartitaIva = PartitaIva;
|
||||
model.Cap = Cap;
|
||||
model.Citta = Citta;
|
||||
model.Indirizzo = Indirizzo;
|
||||
model.Email = Email;
|
||||
model.EmailInvito = EmailInvito;
|
||||
model.NumeroTelefono = NumeroTelefono;
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
61
StandManager/Model/EventoViewModel.cs
Normal file
61
StandManager/Model/EventoViewModel.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using StandManager.Domain.Entita;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace StandManager.Model;
|
||||
|
||||
public class EventoViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[Required(ErrorMessage = "Il titolo è obbligatorio")]
|
||||
public string Titolo { get; set; }
|
||||
public string Descrizione { get; set; }
|
||||
[Required(ErrorMessage = "Il luogo è obbligatorio")]
|
||||
public string Luogo { get; set; }
|
||||
[Required(ErrorMessage = "Il template di invito è obbligatorio")]
|
||||
public string TemplateHtmlMailInvito { get; set; }
|
||||
[Required(ErrorMessage = "Il template di iscrizione è obbligatorio")]
|
||||
public string TemplateHtmlMailIscrizione { get; set; }
|
||||
[Required(ErrorMessage = "La data di inizio è obbligatoria")]
|
||||
public DateTime DataDa { get; set; }
|
||||
[Required(ErrorMessage = "La data di fine è obbligatoria")]
|
||||
public DateTime DataA { get; set; }
|
||||
[Required(ErrorMessage = "La data di inizio iscrizione è obbligatoria")]
|
||||
public DateTime IscrizioneDa { get; set; }
|
||||
[Required(ErrorMessage = "La data di fine iscrizione è obbligatoria")]
|
||||
public DateTime IscrizioneA { get; set; }
|
||||
|
||||
public static implicit operator EventoViewModel(Evento model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new EventoViewModel
|
||||
{
|
||||
DataA = model.DataA,
|
||||
DataDa = model.DataDa,
|
||||
Descrizione = model.Descrizione,
|
||||
Luogo = model.Luogo,
|
||||
Id = model.Id,
|
||||
Titolo = model.Titolo,
|
||||
IscrizioneA = model.IscrizioneA,
|
||||
IscrizioneDa = model.IscrizioneDa,
|
||||
TemplateHtmlMailInvito = model.TemplateHtmlMailInvito,
|
||||
TemplateHtmlMailIscrizione = model.TemplateHtmlMailIscrizione
|
||||
};
|
||||
}
|
||||
|
||||
public Evento Map(Evento model)
|
||||
{
|
||||
model.Titolo = Titolo;
|
||||
model.DataDa = DataDa;
|
||||
model.DataA = DataA;
|
||||
model.Descrizione = Descrizione;
|
||||
model.Luogo = Luogo;
|
||||
model.IscrizioneDa = IscrizioneDa;
|
||||
model.IscrizioneA = IscrizioneA;
|
||||
model.TemplateHtmlMailIscrizione = TemplateHtmlMailIscrizione;
|
||||
model.TemplateHtmlMailInvito = TemplateHtmlMailInvito;
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
11
StandManager/Model/LookupViewModel.cs
Normal file
11
StandManager/Model/LookupViewModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace StandManager.Model;
|
||||
public class LookupViewModel<T>
|
||||
{
|
||||
public LookupViewModel(T key, string description)
|
||||
{
|
||||
Key = key;
|
||||
Description = description;
|
||||
}
|
||||
public T Key { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
30
StandManager/Model/ReferenteViewModel.cs
Normal file
30
StandManager/Model/ReferenteViewModel.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Model;
|
||||
|
||||
public class ReferenteViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Nome { get; set; }
|
||||
public string Cognome { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public Ruolo Ruolo { get; set; }
|
||||
public string RuoloNote { get; set; }
|
||||
|
||||
public static implicit operator ReferenteViewModel(Referente model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ReferenteViewModel()
|
||||
{
|
||||
Id = model.Id,
|
||||
Cognome = model.Cognome,
|
||||
Email = model.Email,
|
||||
NumeroTelefono=model.NumeroTelefono,
|
||||
Ruolo = model.Ruolo,
|
||||
Nome = model.Nome,
|
||||
RuoloNote = model.RuoloNote
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -16,6 +16,7 @@ namespace StandManager.Model
|
||||
public string Nome { get; set; }
|
||||
[Required(ErrorMessage = "Il cognome è obbligatorio")]
|
||||
public string Cognome { get; set; }
|
||||
public string Info => $"{Nome} {Cognome}";
|
||||
|
||||
public static implicit operator UtenteViewModel(Utente? model)
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc
|
||||
.AddCookie(options =>
|
||||
{
|
||||
options.Cookie.Name = "auth_token";
|
||||
options.Cookie.MaxAge = TimeSpan.FromMinutes(30);
|
||||
options.Cookie.MaxAge = TimeSpan.FromHours(8);
|
||||
options.LoginPath = "/account/login";
|
||||
options.LogoutPath = "/account/logout";
|
||||
options.AccessDeniedPath = "/access-denied";
|
||||
|
||||
64
StandManager/Utils/EnumUtils.cs
Normal file
64
StandManager/Utils/EnumUtils.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using StandManager.Model;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace StandManager.Utils;
|
||||
|
||||
public class EnumUtils
|
||||
{
|
||||
public string GetDescription<T>(T doc)
|
||||
{
|
||||
// Ottiene le informazioni del membro
|
||||
MemberInfo[] memberInfo = typeof(T).GetMember(doc.ToString());
|
||||
if (memberInfo.Length > 0)
|
||||
{
|
||||
object[] attrs = memberInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
if (attrs.Length > 0)
|
||||
{
|
||||
return ((DescriptionAttribute)attrs[0]).Description;
|
||||
}
|
||||
}
|
||||
|
||||
return doc.ToString();
|
||||
}
|
||||
|
||||
public int GetInt<T>(T doc)
|
||||
{
|
||||
return Convert.ToInt32(doc);
|
||||
}
|
||||
|
||||
public string GetVal<T, TAttr>(T doc)
|
||||
{
|
||||
MemberInfo[] memberInfo = typeof(T).GetMember(doc.ToString());
|
||||
if (memberInfo.Length > 0)
|
||||
{
|
||||
object[] attrs = memberInfo[0].GetCustomAttributes(typeof(TAttr), false);
|
||||
if (attrs.Length > 0)
|
||||
{
|
||||
object attributeInstance = attrs[0];
|
||||
Type attributeType = attributeInstance.GetType();
|
||||
|
||||
var attributeName = typeof(TAttr).Name.Replace("Attribute", string.Empty);
|
||||
|
||||
PropertyInfo prop = attributeType.GetProperty(attributeName, BindingFlags.Public | BindingFlags.Instance);
|
||||
if (prop != null)
|
||||
{
|
||||
object value = prop.GetValue(attributeInstance);
|
||||
return value?.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return doc.ToString();
|
||||
}
|
||||
|
||||
public List<LookupViewModel<int>> GetEnumList<T>() where T : Enum
|
||||
{
|
||||
return Enum.GetValues(typeof(T))
|
||||
.Cast<T>()
|
||||
.Select(e => new LookupViewModel<int>(
|
||||
Convert.ToInt32(e),
|
||||
GetDescription(e)))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,4 @@
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
|
||||
namespace StandManager.Utils;
|
||||
namespace StandManager.Utils;
|
||||
|
||||
public class LayoutState
|
||||
{
|
||||
@ -14,14 +12,3 @@ public class LayoutState
|
||||
OnChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MembershipUtils
|
||||
{
|
||||
public static async Task<Guid> GetUserId(AuthenticationStateProvider auth)
|
||||
{
|
||||
var state = await auth.GetAuthenticationStateAsync();
|
||||
var idClaim = state.User.FindFirst("UserId")?.Value;
|
||||
|
||||
return Guid.Parse(idClaim ?? Guid.Empty.ToString());
|
||||
}
|
||||
}
|
||||
14
StandManager/Utils/MembershipUtils.cs
Normal file
14
StandManager/Utils/MembershipUtils.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
|
||||
namespace StandManager.Utils;
|
||||
|
||||
public static class MembershipUtils
|
||||
{
|
||||
public static async Task<Guid> GetUserId(AuthenticationStateProvider auth)
|
||||
{
|
||||
var state = await auth.GetAuthenticationStateAsync();
|
||||
var idClaim = state.User.FindFirst("UserId")?.Value;
|
||||
|
||||
return Guid.Parse(idClaim ?? Guid.Empty.ToString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user