Prov/Citt
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourcePerFileMappings">
|
<component name="DataSourcePerFileMappings">
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba/console.sql" value="3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba" />
|
||||||
|
<file url="file://$APPLICATION_CONFIG_DIR$/consoles/db/3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba/console_1.sql" value="3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba" />
|
||||||
<file url="file://$PROJECT_DIR$/.idea/.idea.StandManager/.idea/queries/Query.sql" value="3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba" />
|
<file url="file://$PROJECT_DIR$/.idea/.idea.StandManager/.idea/queries/Query.sql" value="3724eeb7-f7cc-4309-8bf7-54ce3ccd67ba" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using StandManager.Domain.Entita.Base;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using StandManager.Domain.Entita.Base;
|
||||||
|
|
||||||
namespace StandManager.Domain.Entita;
|
namespace StandManager.Domain.Entita;
|
||||||
|
|
||||||
@ -10,4 +11,8 @@ public class ComuneIstat : EntitaBase
|
|||||||
public string Provincia { get; set; }
|
public string Provincia { get; set; }
|
||||||
public string Prefisso { get; set; }
|
public string Prefisso { get; set; }
|
||||||
public string CodFisco { get; set; }
|
public string CodFisco { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey(nameof(ProvinciaIstat))]
|
||||||
|
public Guid? ProvinciaIstatId { get; set; }
|
||||||
|
public ProvinciaIstat ProvinciaIstat { get; set; }
|
||||||
}
|
}
|
||||||
@ -19,6 +19,14 @@ public class Destinazione : EntitaBase
|
|||||||
public string? EmailInvito { get; set; }
|
public string? EmailInvito { get; set; }
|
||||||
public string? NumeroTelefono { get; set; }
|
public string? NumeroTelefono { get; set; }
|
||||||
public string? Rid { get; set; }
|
public string? Rid { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey(nameof(ComuneIstat))]
|
||||||
|
public Guid? ComuneIstatId { get; set; }
|
||||||
|
public ComuneIstat ComuneIstat { get; set; }
|
||||||
|
|
||||||
|
[ForeignKey(nameof(ProvinciaIstat))]
|
||||||
|
public Guid? ProvinciaIstatId { get; set; }
|
||||||
|
public ProvinciaIstat ProvinciaIstat { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(Agente))]
|
[ForeignKey(nameof(Agente))]
|
||||||
public Guid? AgenteId { get; set; }
|
public Guid? AgenteId { get; set; }
|
||||||
|
|||||||
9
StandManager.Infrastructure/20260107-Rilascio.sql
Normal file
9
StandManager.Infrastructure/20260107-Rilascio.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
BEGIN TRANSACTION;
|
||||||
|
ALTER TABLE [Destinazione] ADD [Provincia] nvarchar(max) NULL;
|
||||||
|
|
||||||
|
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
|
||||||
|
VALUES (N'20251223132320_ProvinciaInDest', N'9.0.11');
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
GO
|
||||||
|
|
||||||
1198
StandManager.Infrastructure/Migrations/20260107093044_CittaEProv.Designer.cs
generated
Normal file
1198
StandManager.Infrastructure/Migrations/20260107093044_CittaEProv.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,79 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace StandManager.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class CittaEProv : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ComuneIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ProvinciaIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Destinazione_ComuneIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
column: "ComuneIstatId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Destinazione_ProvinciaIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
column: "ProvinciaIstatId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Destinazione_ComuneIstat_ComuneIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
column: "ComuneIstatId",
|
||||||
|
principalTable: "ComuneIstat",
|
||||||
|
principalColumn: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Destinazione_Province_ProvinciaIstatId",
|
||||||
|
table: "Destinazione",
|
||||||
|
column: "ProvinciaIstatId",
|
||||||
|
principalTable: "Province",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Destinazione_ComuneIstat_ComuneIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Destinazione_Province_ProvinciaIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Destinazione_ComuneIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Destinazione_ProvinciaIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ComuneIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ProvinciaIstatId",
|
||||||
|
table: "Destinazione");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1209
StandManager.Infrastructure/Migrations/20260107093529_ProvSuComune.Designer.cs
generated
Normal file
1209
StandManager.Infrastructure/Migrations/20260107093529_ProvSuComune.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace StandManager.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class ProvSuComune : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat",
|
||||||
|
type: "uniqueidentifier",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ComuneIstat_ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat",
|
||||||
|
column: "ProvinciaIstatId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ComuneIstat_Province_ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat",
|
||||||
|
column: "ProvinciaIstatId",
|
||||||
|
principalTable: "Province",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_ComuneIstat_Province_ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_ComuneIstat_ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ProvinciaIstatId",
|
||||||
|
table: "ComuneIstat");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -143,6 +143,9 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ProvinciaIstatId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("Regione")
|
b.Property<string>("Regione")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
@ -153,6 +156,8 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
|
|
||||||
b.HasIndex("IdUtenteModifica");
|
b.HasIndex("IdUtenteModifica");
|
||||||
|
|
||||||
|
b.HasIndex("ProvinciaIstatId");
|
||||||
|
|
||||||
b.ToTable("ComuneIstat");
|
b.ToTable("ComuneIstat");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -177,6 +182,9 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
b.Property<string>("CodiceFiscale")
|
b.Property<string>("CodiceFiscale")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ComuneIstatId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTime>("DataCreazione")
|
b.Property<DateTime>("DataCreazione")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
@ -211,6 +219,9 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
b.Property<string>("Provincia")
|
b.Property<string>("Provincia")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ProvinciaIstatId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("RagioneSociale")
|
b.Property<string>("RagioneSociale")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
@ -224,10 +235,14 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
|
|
||||||
b.HasIndex("ClienteId");
|
b.HasIndex("ClienteId");
|
||||||
|
|
||||||
|
b.HasIndex("ComuneIstatId");
|
||||||
|
|
||||||
b.HasIndex("IdUtenteCreazione");
|
b.HasIndex("IdUtenteCreazione");
|
||||||
|
|
||||||
b.HasIndex("IdUtenteModifica");
|
b.HasIndex("IdUtenteModifica");
|
||||||
|
|
||||||
|
b.HasIndex("ProvinciaIstatId");
|
||||||
|
|
||||||
b.ToTable("Destinazione");
|
b.ToTable("Destinazione");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -843,6 +858,12 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("IdUtenteModifica");
|
.HasForeignKey("IdUtenteModifica");
|
||||||
|
|
||||||
|
b.HasOne("StandManager.Domain.Entita.ProvinciaIstat", "ProvinciaIstat")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProvinciaIstatId");
|
||||||
|
|
||||||
|
b.Navigation("ProvinciaIstat");
|
||||||
|
|
||||||
b.Navigation("UtenteCreazione");
|
b.Navigation("UtenteCreazione");
|
||||||
|
|
||||||
b.Navigation("UtenteModifica");
|
b.Navigation("UtenteModifica");
|
||||||
@ -858,6 +879,10 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.WithMany("Destinazioni")
|
.WithMany("Destinazioni")
|
||||||
.HasForeignKey("ClienteId");
|
.HasForeignKey("ClienteId");
|
||||||
|
|
||||||
|
b.HasOne("StandManager.Domain.Entita.ComuneIstat", "ComuneIstat")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ComuneIstatId");
|
||||||
|
|
||||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("IdUtenteCreazione");
|
.HasForeignKey("IdUtenteCreazione");
|
||||||
@ -866,10 +891,18 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("IdUtenteModifica");
|
.HasForeignKey("IdUtenteModifica");
|
||||||
|
|
||||||
|
b.HasOne("StandManager.Domain.Entita.ProvinciaIstat", "ProvinciaIstat")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ProvinciaIstatId");
|
||||||
|
|
||||||
b.Navigation("Agente");
|
b.Navigation("Agente");
|
||||||
|
|
||||||
b.Navigation("Cliente");
|
b.Navigation("Cliente");
|
||||||
|
|
||||||
|
b.Navigation("ComuneIstat");
|
||||||
|
|
||||||
|
b.Navigation("ProvinciaIstat");
|
||||||
|
|
||||||
b.Navigation("UtenteCreazione");
|
b.Navigation("UtenteCreazione");
|
||||||
|
|
||||||
b.Navigation("UtenteModifica");
|
b.Navigation("UtenteModifica");
|
||||||
@ -920,7 +953,7 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.HasForeignKey("ClienteId");
|
.HasForeignKey("ClienteId");
|
||||||
|
|
||||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||||
.WithMany()
|
.WithMany("InvitoEventoList")
|
||||||
.HasForeignKey("EventoId");
|
.HasForeignKey("EventoId");
|
||||||
|
|
||||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||||
@ -955,7 +988,7 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
.HasForeignKey("DestinazioneId");
|
.HasForeignKey("DestinazioneId");
|
||||||
|
|
||||||
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
b.HasOne("StandManager.Domain.Entita.Evento", "Evento")
|
||||||
.WithMany()
|
.WithMany("IscrizioneEventoList")
|
||||||
.HasForeignKey("EventoId");
|
.HasForeignKey("EventoId");
|
||||||
|
|
||||||
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
b.HasOne("StandManager.Domain.Entita.Utente", "UtenteCreazione")
|
||||||
@ -1144,6 +1177,13 @@ namespace StandManager.Infrastructure.Migrations
|
|||||||
b.Navigation("Referenti");
|
b.Navigation("Referenti");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("StandManager.Domain.Entita.Evento", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("InvitoEventoList");
|
||||||
|
|
||||||
|
b.Navigation("IscrizioneEventoList");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
modelBuilder.Entity("StandManager.Domain.Entita.InvitoEvento", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("IscrizioniEvento");
|
b.Navigation("IscrizioniEvento");
|
||||||
|
|||||||
13
StandManager/.config/dotnet-tools.json
Normal file
13
StandManager/.config/dotnet-tools.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-ef": {
|
||||||
|
"version": "10.0.1",
|
||||||
|
"commands": [
|
||||||
|
"dotnet-ef"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -38,26 +38,39 @@
|
|||||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@destinazione.Cap" />
|
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@destinazione.Cap" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-3 mb-3">
|
||||||
|
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Provincia</RadzenText>
|
||||||
|
<RadzenDropDown TValue="Guid?" Data="provList" TextProperty="Description" ValueProperty="Key" Style="width: 100%" aria-label="Provincia" @bind-Value="@destinazione.ProvinceId" Change="onProvChanged"
|
||||||
|
AllowFiltering="true"
|
||||||
|
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||||
|
FilterOperator="StringFilterOperator.Contains"
|
||||||
|
FilterPlaceholder="Cerca provincia..."/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-3 mb-3">
|
<div class="col-3 mb-3">
|
||||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Citta</RadzenText>
|
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Citta</RadzenText>
|
||||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@destinazione.Citta" />
|
<RadzenDropDown TValue="Guid?" Data="cittaList" TextProperty="Description" ValueProperty="Key" Style="width: 100%" aria-label="Provincia" @bind-Value="@destinazione.CittaId"
|
||||||
|
AllowFiltering="true"
|
||||||
|
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||||
|
FilterOperator="StringFilterOperator.Contains"
|
||||||
|
FilterPlaceholder="Cerca provincia..."/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-3 mb-3">
|
<div class="col-3 mb-3">
|
||||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Indirizzo</RadzenText>
|
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Indirizzo</RadzenText>
|
||||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.Indirizzo" />
|
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.Indirizzo" />
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<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 class="col-3 mb-3">
|
<div class="col-3 mb-3">
|
||||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Agente</RadzenText>
|
<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" Disabled="@(!canSetAgente)" />
|
<RadzenDropDown Style="width: 100%" TValue="Guid?" @bind-Value=@destinazione.AgenteId Data=@agenti TextProperty="Info" ValueProperty="Id" Name="agenteDestDrop" Disabled="@(!canSetAgente)"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -84,6 +97,8 @@
|
|||||||
private DestinazioneViewModel destinazione { get; set; } = new();
|
private DestinazioneViewModel destinazione { get; set; } = new();
|
||||||
|
|
||||||
private IEnumerable<UtenteViewModel> agenti { get; set; } = new List<UtenteViewModel>();
|
private IEnumerable<UtenteViewModel> agenti { get; set; } = new List<UtenteViewModel>();
|
||||||
|
public List<LookupViewModel<Guid>> provList { get; set; } = new();
|
||||||
|
public List<LookupViewModel<Guid>> cittaList { get; set; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inizializza il componente caricando l’elenco degli agenti non eliminati
|
/// Inizializza il componente caricando l’elenco degli agenti non eliminati
|
||||||
@ -97,8 +112,16 @@
|
|||||||
agenti = (await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false && !x.IsCapoarea && x.CapoareaId == capoareaId, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome)))
|
agenti = (await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false && !x.IsCapoarea && x.CapoareaId == capoareaId, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome)))
|
||||||
.Select(x => (UtenteViewModel)x).ToList();
|
.Select(x => (UtenteViewModel)x).ToList();
|
||||||
|
|
||||||
destinazione = destinazioneId == Guid.Empty ? new() : await _managerService.DestinazioneService.RicercaPer(x => x.Id == destinazioneId,
|
destinazione = destinazioneId == Guid.Empty ? new() : await _managerService.DestinazioneService.RicercaPer(
|
||||||
includi: x => x.Include(y =>y.Agente));
|
x => x.Id == destinazioneId,
|
||||||
|
includi: x => x.Include(y =>y.Agente).Include(y => y.ComuneIstat).Include(y => y.ProvinciaIstat));
|
||||||
|
|
||||||
|
provList = (await _managerService.ProvinciaIstatService.RicercaQueryable(x => x.Eliminato == false))
|
||||||
|
.Select(x => new LookupViewModel<Guid>(x.Id, x.Provincia)).ToList();
|
||||||
|
cittaList = destinazione.ProvinceId.HasValue
|
||||||
|
? (await _managerService.ComuneIstatService.RicercaQueryable(x => x.ProvinciaIstatId == destinazione.ProvinceId.GetValueOrDefault()))
|
||||||
|
.Select(x => new LookupViewModel<Guid>(x.Id, x.Comune)).ToList()
|
||||||
|
: new();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -116,6 +139,9 @@
|
|||||||
if (destinazione.AgenteId.GetValueOrDefault() != Guid.Empty)
|
if (destinazione.AgenteId.GetValueOrDefault() != Guid.Empty)
|
||||||
model.Agente = await _managerService.UtenteService.RicercaPer(x => x.Id == destinazione.AgenteId);
|
model.Agente = await _managerService.UtenteService.RicercaPer(x => x.Id == destinazione.AgenteId);
|
||||||
|
|
||||||
|
model.ProvinciaIstatId = destinazione.ProvinceId;
|
||||||
|
model.ComuneIstatId = destinazione.CittaId;
|
||||||
|
|
||||||
await _managerService.DestinazioneService.Salva(model, idClaim);
|
await _managerService.DestinazioneService.Salva(model, idClaim);
|
||||||
_dialogService.Close(true);
|
_dialogService.Close(true);
|
||||||
}
|
}
|
||||||
@ -127,4 +153,10 @@
|
|||||||
{
|
{
|
||||||
_dialogService.Close(true);
|
_dialogService.Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task onProvChanged(object value)
|
||||||
|
{
|
||||||
|
cittaList = (await _managerService.ComuneIstatService.RicercaQueryable(x => x.ProvinciaIstatId == destinazione.ProvinceId.GetValueOrDefault()))
|
||||||
|
.Select(x => new LookupViewModel<Guid>(x.Id, x.Comune)).ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,6 @@
|
|||||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||||
Data="@clienti" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
Data="@clienti" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||||
<Columns>
|
<Columns>
|
||||||
<RadzenDataGridColumn Property="@nameof(Cliente.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
|
||||||
<RadzenDataGridColumn Property="@nameof(Cliente.RagioneSociale)" Title="Ragione sociale" Width="250px" />
|
<RadzenDataGridColumn Property="@nameof(Cliente.RagioneSociale)" Title="Ragione sociale" Width="250px" />
|
||||||
<RadzenDataGridColumn Property="@nameof(Cliente.PartitaIva)" Title="Partita IVA" Width="250px" />
|
<RadzenDataGridColumn Property="@nameof(Cliente.PartitaIva)" Title="Partita IVA" Width="250px" />
|
||||||
<RadzenDataGridColumn Property="Agente.Info" Title="Agente" Width="250px" />
|
<RadzenDataGridColumn Property="Agente.Info" Title="Agente" Width="250px" />
|
||||||
|
|||||||
@ -33,7 +33,6 @@
|
|||||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||||
Data="@eventi" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
Data="@eventi" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||||
<Columns>
|
<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.Titolo)" Title="Titolo" Width="250px" />
|
||||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataDa)" FormatString="{0:dd/MM/yyyy}" Title="Dal" Width="250px" />
|
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataDa)" FormatString="{0:dd/MM/yyyy}" Title="Dal" Width="250px" />
|
||||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataA)" FormatString="{0:dd/MM/yyyy}" Title="Al" Width="250px" />
|
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataA)" FormatString="{0:dd/MM/yyyy}" Title="Al" Width="250px" />
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="row row-cards">
|
<div class="row row-cards">
|
||||||
<div class="col-3">
|
<div class="col-4">
|
||||||
<Widget_Clienti senzaAgente="false"/>
|
<Widget_Clienti senzaAgente="false"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-4">
|
||||||
<Widget_Clienti senzaAgente="true"/>
|
<Widget_Clienti senzaAgente="true"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-4">
|
||||||
<Widget_Evento/>
|
<Widget_Evento/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@page "/management/Ruoli"
|
@page "/management/Ruoli"
|
||||||
@using ClosedXML.Excel
|
|
||||||
@using Microsoft.EntityFrameworkCore
|
|
||||||
@using StandManager.Model
|
@using StandManager.Model
|
||||||
@using System.Threading.Tasks
|
|
||||||
|
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
@inject AuthenticationStateProvider auth
|
|
||||||
|
|
||||||
<PageTitle>Ruoli</PageTitle>
|
<PageTitle>Ruoli</PageTitle>
|
||||||
|
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
@ -35,7 +30,6 @@
|
|||||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||||
Data="@ruoli" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
Data="@ruoli" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||||
<Columns>
|
<Columns>
|
||||||
<RadzenDataGridColumn Property="@nameof(RuoloViewModel.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
|
||||||
<RadzenDataGridColumn Property="@nameof(RuoloViewModel.Nome)" Title="Nome" Width="250px" />
|
<RadzenDataGridColumn Property="@nameof(RuoloViewModel.Nome)" Title="Nome" Width="250px" />
|
||||||
|
|
||||||
<RadzenDataGridColumn Context="ruolo" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
<RadzenDataGridColumn Context="ruolo" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
||||||
@ -89,7 +83,7 @@
|
|||||||
|
|
||||||
if (ok == true)
|
if (ok == true)
|
||||||
{
|
{
|
||||||
await _managerService.RuoloService.Elimina(ruolo.Id, await MembershipUtils.GetUserId(auth));
|
await _managerService.RuoloService.Elimina(ruolo.Id, await MembershipUtils.GetUserId(_auth));
|
||||||
ruoli = (await _managerService.RuoloService.RicercaQueryable(x => x.Eliminato == false))
|
ruoli = (await _managerService.RuoloService.RicercaQueryable(x => x.Eliminato == false))
|
||||||
.Select(x => (RuoloViewModel)x).ToList();
|
.Select(x => (RuoloViewModel)x).ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||||
Data="@utenti" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
Data="@utenti" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||||
<Columns>
|
<Columns>
|
||||||
<RadzenDataGridColumn Property="@nameof(Utente.Id)" Filterable="false" Title="ID" Width="80px" TextAlign="TextAlign.Center" />
|
|
||||||
<RadzenDataGridColumn Property="@nameof(Utente.Nome)" Title="Nome" Width="160px" />
|
<RadzenDataGridColumn Property="@nameof(Utente.Nome)" Title="Nome" Width="160px" />
|
||||||
<RadzenDataGridColumn Property="@nameof(Utente.Cognome)" Title="Cognome" Width="160px" />
|
<RadzenDataGridColumn Property="@nameof(Utente.Cognome)" Title="Cognome" Width="160px" />
|
||||||
<RadzenDataGridColumn Property="@nameof(Utente.Email)" Title="Mail" Width="200px" />
|
<RadzenDataGridColumn Property="@nameof(Utente.Email)" Title="Mail" Width="200px" />
|
||||||
|
|||||||
@ -17,7 +17,9 @@
|
|||||||
var clientiSenza = senzaAgente
|
var clientiSenza = senzaAgente
|
||||||
? await _managerService.ClienteService.RicercaQueryable(x => x.AgenteId == null)
|
? await _managerService.ClienteService.RicercaQueryable(x => x.AgenteId == null)
|
||||||
: await _managerService.ClienteService.RicercaQueryable(x => x.CapoareaId == null);
|
: await _managerService.ClienteService.RicercaQueryable(x => x.CapoareaId == null);
|
||||||
totale = clientiSenza.Count();
|
totale = clientiSenza == null
|
||||||
|
? 0
|
||||||
|
: clientiSenza.Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
var nextEvent = await _managerService.EventoService.RicercaPer(x => x.DataDa >= DateTime.Now && x.Eliminato == false,
|
var nextEvent = await _managerService.EventoService.RicercaPer(x => x.DataDa >= DateTime.Now && x.Eliminato == false,
|
||||||
includi:x => x.Include(y => y.InvitoEventoList), ordinamento:x => x.OrderBy(y => y.DataDa));
|
includi:x => x.Include(y => y.InvitoEventoList), ordinamento:x => x.OrderBy(y => y.DataDa));
|
||||||
totale = nextEvent.InvitoEventoList.Count();
|
totale = nextEvent == null
|
||||||
|
? 0
|
||||||
|
: nextEvent.InvitoEventoList.Count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,6 +18,8 @@ public class DestinazioneViewModel
|
|||||||
public string EmailInvito { get; set; }
|
public string EmailInvito { get; set; }
|
||||||
public string NumeroTelefono { get; set; }
|
public string NumeroTelefono { get; set; }
|
||||||
public Guid? AgenteId { get; set; }
|
public Guid? AgenteId { get; set; }
|
||||||
|
public Guid? ProvinceId { get; set; }
|
||||||
|
public Guid? CittaId { get; set; }
|
||||||
public string NomeAgente { get; set; }
|
public string NomeAgente { get; set; }
|
||||||
public UtenteViewModel Agente { get; set; }
|
public UtenteViewModel Agente { get; set; }
|
||||||
public List<ReferenteViewModel> Referenti { get; set; }
|
public List<ReferenteViewModel> Referenti { get; set; }
|
||||||
@ -43,7 +45,9 @@ public class DestinazioneViewModel
|
|||||||
NumeroTelefono = model.NumeroTelefono,
|
NumeroTelefono = model.NumeroTelefono,
|
||||||
PartitaIva = model.PartitaIva,
|
PartitaIva = model.PartitaIva,
|
||||||
RagioneSociale = model.RagioneSociale,
|
RagioneSociale = model.RagioneSociale,
|
||||||
Referenti = model.Referenti?.Select(x => (ReferenteViewModel)x).ToList() ?? new List<ReferenteViewModel>()
|
Referenti = model.Referenti?.Select(x => (ReferenteViewModel)x).ToList() ?? new List<ReferenteViewModel>(),
|
||||||
|
ProvinceId = model.ProvinciaIstatId,
|
||||||
|
CittaId = model.ComuneIstatId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
28
script.sql
Normal file
28
script.sql
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
BEGIN TRANSACTION;
|
||||||
|
ALTER TABLE [Destinazione] ADD [ComuneIstatId] uniqueidentifier NULL;
|
||||||
|
|
||||||
|
ALTER TABLE [Destinazione] ADD [ProvinciaIstatId] uniqueidentifier NULL;
|
||||||
|
|
||||||
|
CREATE INDEX [IX_Destinazione_ComuneIstatId] ON [Destinazione] ([ComuneIstatId]);
|
||||||
|
|
||||||
|
CREATE INDEX [IX_Destinazione_ProvinciaIstatId] ON [Destinazione] ([ProvinciaIstatId]);
|
||||||
|
|
||||||
|
ALTER TABLE [Destinazione] ADD CONSTRAINT [FK_Destinazione_ComuneIstat_ComuneIstatId] FOREIGN KEY ([ComuneIstatId]) REFERENCES [ComuneIstat] ([Id]);
|
||||||
|
|
||||||
|
ALTER TABLE [Destinazione] ADD CONSTRAINT [FK_Destinazione_Province_ProvinciaIstatId] FOREIGN KEY ([ProvinciaIstatId]) REFERENCES [Province] ([Id]);
|
||||||
|
|
||||||
|
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
|
||||||
|
VALUES (N'20260107093044_CittaEProv', N'9.0.11');
|
||||||
|
|
||||||
|
ALTER TABLE [ComuneIstat] ADD [ProvinciaIstatId] uniqueidentifier NULL;
|
||||||
|
|
||||||
|
CREATE INDEX [IX_ComuneIstat_ProvinciaIstatId] ON [ComuneIstat] ([ProvinciaIstatId]);
|
||||||
|
|
||||||
|
ALTER TABLE [ComuneIstat] ADD CONSTRAINT [FK_ComuneIstat_Province_ProvinciaIstatId] FOREIGN KEY ([ProvinciaIstatId]) REFERENCES [Province] ([Id]);
|
||||||
|
|
||||||
|
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
|
||||||
|
VALUES (N'20260107093529_ProvSuComune', N'9.0.11');
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
GO
|
||||||
|
|
||||||
Reference in New Issue
Block a user