Iscrizione
This commit is contained in:
@ -20,4 +20,13 @@ public class Cliente : EntitaBase
|
||||
|
||||
[InverseProperty(nameof(Destinazione.Cliente))]
|
||||
public List<Destinazione> Destinazioni { get; set; }
|
||||
|
||||
public string Rid { get; set; }
|
||||
public ClienteTipo TipologiaCliente { get; set; }
|
||||
}
|
||||
|
||||
public enum ClienteTipo
|
||||
{
|
||||
Cliente = 0,
|
||||
Lead = 99
|
||||
}
|
||||
|
||||
@ -3,12 +3,27 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Domain.Entita;
|
||||
|
||||
public class InvitoEvento : EntitaBase
|
||||
{
|
||||
[ForeignKey(nameof(Evento))]
|
||||
public Guid? EventoId { get; set; }
|
||||
public Evento Evento{ get; set; }
|
||||
|
||||
[ForeignKey(nameof(Cliente))]
|
||||
public Guid? ClienteId { get; set; }
|
||||
public Cliente Cliente { get; set; }
|
||||
}
|
||||
|
||||
public class IscrizioneEvento : EntitaBase
|
||||
{
|
||||
[ForeignKey(nameof(Evento))]
|
||||
public Guid? EventoId { get; set; }
|
||||
public Evento Evento{ get; set; }
|
||||
|
||||
[ForeignKey(nameof(InvitoEvento))]
|
||||
public Guid? InvitoEventoId { get; set; }
|
||||
public InvitoEvento InvitoEvento { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Cliente))]
|
||||
public Guid? ClienteId { get; set; }
|
||||
public Cliente Cliente { get; set; }
|
||||
|
||||
@ -14,6 +14,7 @@ public class StandManagerDbContext : OAServiceContext
|
||||
public DbSet<Cliente> Cliente { get; set; }
|
||||
public DbSet<Destinazione> Destinazione { get; set; }
|
||||
public DbSet<Evento> Evento { get; set; }
|
||||
public DbSet<InvitoEvento> InvitoEvento { get; set; }
|
||||
public DbSet<IscrizioneEvento> IscrizioneEvento { get; set; }
|
||||
public DbSet<Referente> Referente { get; set; }
|
||||
public DbSet<Utente> Utente { get; set; }
|
||||
|
||||
544
StandManager.Infrastructure/Migrations/20251202150620_ModificheAlCliente.Designer.cs
generated
Normal file
544
StandManager.Infrastructure/Migrations/20251202150620_ModificheAlCliente.Designer.cs
generated
Normal file
@ -0,0 +1,544 @@
|
||||
// <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("20251202150620_ModificheAlCliente")]
|
||||
partial class ModificheAlCliente
|
||||
{
|
||||
/// <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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.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<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.Property<string>("Rid")
|
||||
.IsRequired()
|
||||
.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.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<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.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.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.Navigation("Cliente");
|
||||
|
||||
b.Navigation("Destinazione");
|
||||
|
||||
b.Navigation("Evento");
|
||||
|
||||
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,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ModificheAlCliente : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Rid",
|
||||
table: "Cliente",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "TipologiaCliente",
|
||||
table: "Cliente",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Rid",
|
||||
table: "Cliente");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TipologiaCliente",
|
||||
table: "Cliente");
|
||||
}
|
||||
}
|
||||
}
|
||||
622
StandManager.Infrastructure/Migrations/20251202160449_InvitoEvento.Designer.cs
generated
Normal file
622
StandManager.Infrastructure/Migrations/20251202160449_InvitoEvento.Designer.cs
generated
Normal file
@ -0,0 +1,622 @@
|
||||
// <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("20251202160449_InvitoEvento")]
|
||||
partial class InvitoEvento
|
||||
{
|
||||
/// <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")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Citta")
|
||||
.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<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.Property<string>("Rid")
|
||||
.IsRequired()
|
||||
.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,110 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace StandManager.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InvitoEvento : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "InvitoEventoId",
|
||||
table: "IscrizioneEvento",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InvitoEvento",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EventoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
ClienteId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DataCreazione = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DataModifica = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Eliminato = table.Column<bool>(type: "bit", nullable: false),
|
||||
IdUtenteCreazione = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IdUtenteModifica = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InvitoEvento", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_InvitoEvento_Cliente_ClienteId",
|
||||
column: x => x.ClienteId,
|
||||
principalTable: "Cliente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_InvitoEvento_Evento_EventoId",
|
||||
column: x => x.EventoId,
|
||||
principalTable: "Evento",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_InvitoEvento_Utente_IdUtenteCreazione",
|
||||
column: x => x.IdUtenteCreazione,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_InvitoEvento_Utente_IdUtenteModifica",
|
||||
column: x => x.IdUtenteModifica,
|
||||
principalTable: "Utente",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IscrizioneEvento_InvitoEventoId",
|
||||
table: "IscrizioneEvento",
|
||||
column: "InvitoEventoId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvitoEvento_ClienteId",
|
||||
table: "InvitoEvento",
|
||||
column: "ClienteId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvitoEvento_EventoId",
|
||||
table: "InvitoEvento",
|
||||
column: "EventoId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvitoEvento_IdUtenteCreazione",
|
||||
table: "InvitoEvento",
|
||||
column: "IdUtenteCreazione");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InvitoEvento_IdUtenteModifica",
|
||||
table: "InvitoEvento",
|
||||
column: "IdUtenteModifica");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IscrizioneEvento_InvitoEvento_InvitoEventoId",
|
||||
table: "IscrizioneEvento",
|
||||
column: "InvitoEventoId",
|
||||
principalTable: "InvitoEvento",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IscrizioneEvento_InvitoEvento_InvitoEventoId",
|
||||
table: "IscrizioneEvento");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "InvitoEvento");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IscrizioneEvento_InvitoEventoId",
|
||||
table: "IscrizioneEvento");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InvitoEventoId",
|
||||
table: "IscrizioneEvento");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -78,6 +78,13 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Rid")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("TipologiaCliente")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AgenteId");
|
||||
@ -217,6 +224,46 @@ namespace StandManager.Infrastructure.Migrations
|
||||
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")
|
||||
@ -250,6 +297,9 @@ namespace StandManager.Infrastructure.Migrations
|
||||
b.Property<Guid?>("IdUtenteModifica")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("InvitoEventoId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
@ -276,6 +326,8 @@ namespace StandManager.Infrastructure.Migrations
|
||||
|
||||
b.HasIndex("IdUtenteModifica");
|
||||
|
||||
b.HasIndex("InvitoEventoId");
|
||||
|
||||
b.ToTable("IscrizioneEvento");
|
||||
});
|
||||
|
||||
@ -450,6 +502,33 @@ namespace StandManager.Infrastructure.Migrations
|
||||
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")
|
||||
@ -472,12 +551,18 @@ namespace StandManager.Infrastructure.Migrations
|
||||
.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");
|
||||
|
||||
6
StandManager.Service/Interfaces/IInvitoEventoService.cs
Normal file
6
StandManager.Service/Interfaces/IInvitoEventoService.cs
Normal file
@ -0,0 +1,6 @@
|
||||
using OAService.Service.Servizi.Interfacce;
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Service.Interfaces;
|
||||
|
||||
public interface IInvitoEventoService : ITService<InvitoEvento>{}
|
||||
@ -5,6 +5,7 @@
|
||||
public IClienteService ClienteService{ get; set; }
|
||||
public IDestinazioneService DestinazioneService{ get; set; }
|
||||
public IEventoService EventoService{ get; set; }
|
||||
public IInvitoEventoService InvitoEventoService{ get; set; }
|
||||
public IIscrizioneEventoService IscrizioneEventoService{ get; set; }
|
||||
public IReferenteService ReferenteService{ get; set; }
|
||||
public IUtenteService UtenteService { get; set; }
|
||||
|
||||
16
StandManager.Service/InvitoEventoService.cs
Normal file
16
StandManager.Service/InvitoEventoService.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using OAService.Service.Servizi.Implementazioni;
|
||||
using StandManager.Domain.Entita;
|
||||
using StandManager.Service.Interfaces;
|
||||
using StandManager.Service.Repository;
|
||||
|
||||
namespace StandManager.Service;
|
||||
|
||||
public class InvitoEventoService : TService<InvitoEvento>, IInvitoEventoService
|
||||
{
|
||||
private readonly IStandManagerUnitOfWork _unitOfWork;
|
||||
|
||||
public InvitoEventoService(IStandManagerUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
@ -5,12 +5,13 @@ namespace StandManager.Service;
|
||||
public class ManagerService : IManagerService
|
||||
{
|
||||
public ManagerService(IUtenteService utenteService, IClienteService clienteService, IDestinazioneService destinazioneService, IEventoService eventoService,
|
||||
IIscrizioneEventoService iscrizioneEventoService, IReferenteService referenteService)
|
||||
IInvitoEventoService invitoEventoService, IIscrizioneEventoService iscrizioneEventoService, IReferenteService referenteService)
|
||||
{
|
||||
UtenteService = utenteService;
|
||||
ClienteService = clienteService;
|
||||
DestinazioneService = destinazioneService;
|
||||
EventoService = eventoService;
|
||||
InvitoEventoService = invitoEventoService;
|
||||
IscrizioneEventoService = iscrizioneEventoService;
|
||||
ReferenteService = referenteService;
|
||||
}
|
||||
@ -19,6 +20,7 @@ public class ManagerService : IManagerService
|
||||
public IClienteService ClienteService { get; set; }
|
||||
public IDestinazioneService DestinazioneService { get; set; }
|
||||
public IEventoService EventoService { get; set; }
|
||||
public IInvitoEventoService InvitoEventoService{ get; set; }
|
||||
public IIscrizioneEventoService IscrizioneEventoService { get; set; }
|
||||
public IReferenteService ReferenteService { get; set; }
|
||||
}
|
||||
@ -38,5 +38,6 @@
|
||||
<script src="/js/site.js" type="text/javascript" asp-append-version="true"></script>
|
||||
<script src="/Plugin/Select2/js/select2.full.min.js"></script>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>
|
||||
<script src="/js/BodyClass.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -43,21 +43,13 @@
|
||||
<!-- BEGIN NAVBAR MENU -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/">
|
||||
<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>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/management/dashboard">
|
||||
<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"> Dashboard </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/management/Utenti">
|
||||
<span class="nav-link-icon d-md-none d-lg-inline-block">
|
||||
|
||||
@ -1,10 +1,51 @@
|
||||
@page "/"
|
||||
@page "/{invitationId:guid}"
|
||||
@layout PublicLayout
|
||||
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Components.Layout
|
||||
|
||||
@inject BodyClassService BodyClass
|
||||
@rendermode InteractiveServer
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using StandManager.Domain.Entita
|
||||
|
||||
<PageTitle>Home</PageTitle>
|
||||
<PageTitle>Evento</PageTitle>
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
<header class="hero pb-0">
|
||||
<div class="container">
|
||||
@if (invitationId.HasValue)
|
||||
{
|
||||
<h1 class="hero-title">Ciao @invito.Cliente.RagioneSociale - Sei stato invitato a: @invito.Evento.Titolo</h1>
|
||||
<p class="hero-description mt-4">
|
||||
L'evento si terrà dal @invito.Evento.DataDa.ToString("dd/MM/yyyy") al @invito.Evento.DataA.ToString("dd/MM/yyyy"), presso: @invito.Evento.Luogo
|
||||
</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h1 class="hero-title">Iscriviti ad un evento, inserisci il tuo codice di invito</h1>
|
||||
}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Welcome to your new app.
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public Guid? invitationId { get; set; }
|
||||
|
||||
private InvitoEvento invito { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
base.OnInitializedAsync();
|
||||
|
||||
invito = invitationId.GetValueOrDefault() != Guid.Empty
|
||||
? await _managerService.InvitoEventoService.RicercaPer(x => x.Id == invitationId && x.Eliminato == false,
|
||||
includi: x => x.Include(y => y.Evento).Include(y => y.Cliente).ThenInclude(y => y.Destinazioni))
|
||||
: new();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
await BodyClass.SetBodyClass("body-marketing body-gradient");
|
||||
}
|
||||
}
|
||||
@ -1,187 +1,85 @@
|
||||
@page "/management/clienti"
|
||||
@attribute [Authorize]
|
||||
@page "/management/Clienti"
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Domain.Entita
|
||||
@using StandManager.Service.Interfaces
|
||||
@inject IManagerService _managerService
|
||||
@using StandManager.Model
|
||||
|
||||
<h3>Clienti</h3>
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@inject AuthenticationStateProvider auth
|
||||
|
||||
<PageTitle>Clienti</PageTitle>
|
||||
|
||||
@inject IManagerService _managerService
|
||||
<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">Clienti</h2>
|
||||
</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">
|
||||
Nuovo cliente
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<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">
|
||||
<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" />
|
||||
|
||||
<h3>Clienti</h3>
|
||||
|
||||
@*BOZZA NEW VERSION*@
|
||||
@* <RadzenDataGrid TItem="Cliente"
|
||||
@ref="grid"
|
||||
Data="@clienti"
|
||||
AllowFiltering="true"
|
||||
AllowColumnResize="true"
|
||||
AllowAlternatingRows="false"
|
||||
FilterMode="FilterMode.Advanced"
|
||||
AllowSorting="true"
|
||||
PageSize="5"
|
||||
AllowPaging="true"
|
||||
PagerHorizontalAlign="HorizontalAlign.Left"
|
||||
ShowPagingSummary="true"
|
||||
ColumnWidth="300px"
|
||||
LogicalFilterOperator="LogicalFilterOperator.Or"
|
||||
SelectionMode="DataGridSelectionMode.Single"
|
||||
@bind-Value="clienteSelezionato"
|
||||
EditMode="DataGridEditMode.Single">
|
||||
|
||||
<Columns>
|
||||
@* Colonna comandi con toolbar Aggiungi + pulsanti Modifica/Elimina *@
|
||||
@* <RadzenDataGridColumn TItem="Cliente" Context="cliente" Width="200px" Frozen="true">
|
||||
<HeaderTemplate>
|
||||
<RadzenButton Icon="add"
|
||||
Text="Aggiungi"
|
||||
Size="ButtonSize.Small"
|
||||
Click="@AddRow" />
|
||||
</HeaderTemplate>
|
||||
|
||||
<Template Context="cliente">
|
||||
<RadzenButton Icon="edit"
|
||||
ButtonStyle="ButtonStyle.Light"
|
||||
Size="ButtonSize.Small"
|
||||
Click="@(() => EditRow(cliente))" />
|
||||
<RadzenButton Icon="delete"
|
||||
ButtonStyle="ButtonStyle.Danger"
|
||||
Size="ButtonSize.Small"
|
||||
Click="@(() => DeleteRow(cliente))" />
|
||||
</Template>
|
||||
|
||||
<EditTemplate Context="cliente">
|
||||
<RadzenButton Icon="save"
|
||||
ButtonStyle="ButtonStyle.Primary"
|
||||
Size="ButtonSize.Small"
|
||||
Click="@(() => SaveRow(cliente))" />
|
||||
<RadzenButton Icon="cancel"
|
||||
ButtonStyle="ButtonStyle.Light"
|
||||
Size="ButtonSize.Small"
|
||||
Click="@(() => CancelEdit(cliente))" />
|
||||
</EditTemplate>
|
||||
</RadzenDataGridColumn>
|
||||
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Id)" Filterable="false" Title="ID" Width="80px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.RagioneSociale)" Title="Ragione Sociale" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.PartitaIva)" Title="Partita Iva" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Indirizzo)" Title="Indirizzo" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.NumeroTelefono)" Title="Numero di Telefono" Width="120px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Agente)" Title="Agente" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Citta)" Title="Città" Width="160px" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
<RadzenDataGridColumn Context="order" Filterable="false" Sortable="false" TextAlign="TextAlign.Right">
|
||||
<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" />
|
||||
</Template>
|
||||
</RadzenDataGridColumn>
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
RadzenDataGrid<Cliente>? grid;
|
||||
|
||||
List<Cliente> clienti = new();
|
||||
Cliente? clienteSelezionato;
|
||||
Cliente? clienteInInserimento; // per distinguere "nuovo" da "esistente"
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// Prima avevi IQueryable<Cliente>. Ora usiamo List<Cliente> per gestire facilmente CRUD in memoria
|
||||
var query = await _managerService.ClienteService.RicercaQueryable(x => x.Eliminato == false);
|
||||
clienti = await query.ToListAsync();
|
||||
|
||||
clienteSelezionato = clienti.FirstOrDefault();
|
||||
}
|
||||
|
||||
// ========= COMANDI UI (toolbar + pulsanti riga) ==========
|
||||
|
||||
async Task AddRow()
|
||||
{
|
||||
// crea un nuovo cliente in edit
|
||||
clienteInInserimento = new Cliente();
|
||||
clienti.Insert(0, clienteInInserimento);
|
||||
await grid!.InsertRow(clienteInInserimento);
|
||||
}
|
||||
|
||||
async Task EditRow(Cliente cliente)
|
||||
{
|
||||
clienteInInserimento = null; // non è un "nuovo", è edit di esistente
|
||||
await grid!.EditRow(cliente);
|
||||
}
|
||||
|
||||
async Task SaveRow(Cliente cliente)
|
||||
{
|
||||
// Chiude la modalità edit a livello UI
|
||||
await grid!.UpdateRow(cliente);
|
||||
|
||||
// Persistenza su DB
|
||||
if (clienteInInserimento == cliente)
|
||||
{
|
||||
// INSERIMENTO
|
||||
// TODO: sostituisci con il tuo metodo reale
|
||||
// await _managerService.ClienteService.Inserisci(cliente);
|
||||
// await _managerService.UnitOfWork.SalvaAsync();
|
||||
|
||||
clienteInInserimento = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// UPDATE
|
||||
// TODO: sostituisci con il tuo metodo reale
|
||||
// await _managerService.ClienteService.Aggiorna(cliente);
|
||||
// await _managerService.UnitOfWork.SalvaAsync();
|
||||
}
|
||||
}
|
||||
|
||||
void CancelEdit(Cliente cliente)
|
||||
{
|
||||
if (clienteInInserimento == cliente)
|
||||
{
|
||||
// se annullo l'inserimento, tolgo la riga fittizia
|
||||
clienti.Remove(cliente);
|
||||
clienteInInserimento = null;
|
||||
}
|
||||
|
||||
grid!.CancelEditRow(cliente);
|
||||
}
|
||||
|
||||
async Task DeleteRow(Cliente cliente)
|
||||
{
|
||||
// Persistenza su DB
|
||||
// TODO: soft-delete o hard-delete a seconda della tua logica:
|
||||
// cliente.Eliminato = true;
|
||||
// await _managerService.ClienteService.Aggiorna(cliente);
|
||||
// await _managerService.UnitOfWork.SalvaAsync();
|
||||
|
||||
clienti.Remove(cliente);
|
||||
await grid!.Reload();
|
||||
}
|
||||
}
|
||||
*@
|
||||
|
||||
@*OLD VERSION*@
|
||||
<RadzenDataGrid AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.Advanced" AllowSorting="true" PageSize="5" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@clienti" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single" @bind-Value=@clientiSelected>
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Id)" Filterable="false" Title="ID" Frozen="true" Width="80px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.RagioneSociale)" Title="Ragione Sociale" Frozen="true" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.PartitaIva)" Title="Partita Iva" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Indirizzo)" Title="Indirizzo" Width="200px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.NumeroTelefono)" Title="Numero di Telefono" Width="120px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Agente)" Title="Agente" FormatString="{0:d}" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Citta)" Title="Città" FormatString="{0:d}" Width="160px" />
|
||||
</Columns>
|
||||
</RadzenDataGrid>
|
||||
|
||||
@code {
|
||||
IQueryable<Cliente> clienti;
|
||||
IList<Cliente> clientiSelected;
|
||||
List<ClienteViewModel> clienti;
|
||||
RadzenDataGrid<ClienteViewModel> clientiGrid;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
clienti = await _managerService.ClienteService.RicercaQueryable(x => x.Eliminato == false);
|
||||
clienti = (await _managerService.ClienteService.RicercaQueryable(x => x.Eliminato == false, includi: x => x.Include(y => y.Agente)))
|
||||
.Select(x => (ClienteViewModel)x).ToList();
|
||||
}
|
||||
|
||||
clientiSelected = new List<Cliente>() { clienti.FirstOrDefault() };
|
||||
private async Task EditRow(ClienteViewModel cliente)
|
||||
{
|
||||
_navManager.NavigateTo($"/management/Clienti/Modifica/{cliente.Id}");
|
||||
}
|
||||
|
||||
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" });
|
||||
|
||||
if (ok == true)
|
||||
{
|
||||
await _managerService.ClienteService.Elimina(cliente.Id, await MembershipUtils.GetUserId(auth));
|
||||
clienti = (await _managerService.ClienteService.RicercaQueryable(x => x.Eliminato == false, includi: x => x.Include(y => y.Agente)))
|
||||
.Select(x => (ClienteViewModel)x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
@page "/management/Dashboard"
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using StandManager.Components.Layout
|
||||
@attribute [Authorize]
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<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">
|
||||
<!-- Page pre-title -->
|
||||
<div class="page-pretitle">Overview</div>
|
||||
<h2 class="page-title">Dashboard</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Radzen.Blazor.RadzenButton Text="Ciao"></Radzen.Blazor.RadzenButton>
|
||||
|
||||
@code {
|
||||
override protected void OnInitialized()
|
||||
{
|
||||
// Initialization logic can be added here if needed
|
||||
var a = "CIAO";
|
||||
}
|
||||
}
|
||||
2
StandManager/Components/Pages/Management/Home.razor
Normal file
2
StandManager/Components/Pages/Management/Home.razor
Normal file
@ -0,0 +1,2 @@
|
||||
@attribute [Authorize]
|
||||
@page "/management"
|
||||
46
StandManager/Model/ClienteViewModel.cs
Normal file
46
StandManager/Model/ClienteViewModel.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Model
|
||||
{
|
||||
public class ClienteViewModel
|
||||
{
|
||||
public Guid Id { 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 Agente { get; set; }
|
||||
public Guid? AgenteId { get; set; }
|
||||
public List<Destinazione> Destinazioni { get; set; }
|
||||
|
||||
public string Rid { get; set; }
|
||||
public ClienteTipo TipologiaCliente { get; set; }
|
||||
|
||||
public static implicit operator ClienteViewModel(Cliente model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ClienteViewModel()
|
||||
{
|
||||
Agente = model.Agente?.ToString(),
|
||||
AgenteId = model.AgenteId,
|
||||
Cap = model.Cap,
|
||||
Citta = model.Citta,
|
||||
Email = model.Email,
|
||||
EmailInvito = model.EmailInvito,
|
||||
Id = model.Id,
|
||||
Destinazioni = model.Destinazioni,
|
||||
Indirizzo = model.Indirizzo,
|
||||
NumeroTelefono = model.NumeroTelefono,
|
||||
PartitaIva = model.PartitaIva,
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
Rid = model.Rid,
|
||||
TipologiaCliente = model.TipologiaCliente
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
using StandManager.Domain.Entita;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StandManager.Model
|
||||
{
|
||||
|
||||
@ -47,8 +47,9 @@ builder.Services.AddDbContext<StandManagerDbContext>(options =>
|
||||
builder.Services.AddScoped(typeof(IStandManagerGenericRepository<>), typeof(StandManagerGenericRepository<>));
|
||||
builder.Services.AddScoped<IStandManagerUnitOfWork, StandManagerUnitOfWork>();
|
||||
builder.Services.AddScoped<IManagerService, ManagerService>();
|
||||
|
||||
builder.Services.AddScoped<BodyClassService>();
|
||||
builder.Services.AddScoped<LayoutState>();
|
||||
|
||||
builder.Services.AddRadzenComponents();
|
||||
builder.Services.AddHttpContextAccessor();
|
||||
|
||||
|
||||
23
StandManager/Utils/BodyClassService.cs
Normal file
23
StandManager/Utils/BodyClassService.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace StandManager.Utils
|
||||
{
|
||||
public class BodyClassService
|
||||
{
|
||||
private readonly IJSRuntime _js;
|
||||
|
||||
public BodyClassService(IJSRuntime js)
|
||||
{
|
||||
_js = js;
|
||||
}
|
||||
|
||||
public async Task SetBodyClass(string? className)
|
||||
=> await _js.InvokeVoidAsync("bodyClass.set", className);
|
||||
|
||||
public async Task Add(string className)
|
||||
=> await _js.InvokeVoidAsync("bodyClass.add", className);
|
||||
|
||||
public async Task Remove(string className)
|
||||
=> await _js.InvokeVoidAsync("bodyClass.remove", className);
|
||||
}
|
||||
}
|
||||
24
StandManager/wwwroot/js/BodyClass.js
Normal file
24
StandManager/wwwroot/js/BodyClass.js
Normal file
@ -0,0 +1,24 @@
|
||||
window.bodyClass = {
|
||||
set: function (className) {
|
||||
// Rimuove tutte le classi attuali
|
||||
document.body.className = "";
|
||||
|
||||
// Se la classe è valorizzata, la imposta
|
||||
if (className) {
|
||||
document.body.className = className;
|
||||
}
|
||||
},
|
||||
|
||||
add: function (className) {
|
||||
document.body.classList.add(className);
|
||||
},
|
||||
|
||||
remove: function (className) {
|
||||
document.body.classList.remove(className);
|
||||
},
|
||||
|
||||
// Utile se vuoi rimuovere tutto manualmente
|
||||
clear: function () {
|
||||
document.body.className = "";
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user