Fix operatori

This commit is contained in:
2026-02-02 14:10:01 +01:00
parent 9597248a9c
commit a642ac3ce7
11 changed files with 914 additions and 42 deletions

View File

@ -5,7 +5,6 @@ namespace TecniStamp.Domain;
public class Utente : EntitaBase
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Nome { get; set; }

View File

@ -0,0 +1,834 @@
// <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 TecniStamp.Infrastructure.DAL.Context;
#nullable disable
namespace TecniStamp.Infrastructure.Migrations
{
[DbContext(typeof(TecniStampDbContext))]
[Migration("20260202130536_RimossoUsername")]
partial class RimossoUsername
{
/// <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("TecniStamp.Domain.Cliente", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CAP")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Citta")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ComuneId")
.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<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<string>("Indirizzo")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Note")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NumeroCivico")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Paese")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PartitaIva")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Provincia")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RagioneSociale")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Telefono")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Via")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ComuneId");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("Cliente");
});
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("AnnoCommessa")
.HasColumnType("int");
b.Property<Guid?>("ClienteId")
.HasColumnType("uniqueidentifier");
b.Property<string>("CodiceCommessa")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DataConsegna")
.HasColumnType("datetime2");
b.Property<DateTime>("DataConsegnaPrevista")
.HasColumnType("datetime2");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<DateTime>("DataOrdine")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<string>("OrdineNr")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal?>("OreTotali")
.HasColumnType("decimal(18,2)");
b.Property<string>("RiferimentoCliente")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Stato")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ClienteId");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("Commessa");
});
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CodFisco")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Comune")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<string>("Istat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefisso")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Provincia")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("ProvinciaIstatId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Regione")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("ProvinciaIstatId");
b.ToTable("ComuneIstat");
});
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.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>("Nome")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Ordinamento")
.HasColumnType("int");
b.Property<Guid>("SezioneId")
.HasColumnType("uniqueidentifier");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("SezioneId");
b.ToTable("Feature");
});
modelBuilder.Entity("TecniStamp.Domain.Lavorazione", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ChiaveEsterna")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Codice")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CodiceColore")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<float?>("CostoOrario")
.HasColumnType("real");
b.Property<DateTime>("DataCreazione")
.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<bool>("Sovrapponibile")
.HasColumnType("bit");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("Lavorazione");
});
modelBuilder.Entity("TecniStamp.Domain.Macchinario", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CodiceEsterno")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ConfigurazioneJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ConfigurazionePercorso")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DataCreazione")
.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<bool>("Interscambio")
.HasColumnType("bit");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("Macchinario");
});
modelBuilder.Entity("TecniStamp.Domain.Permission", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<Guid>("IdFeature")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("RuoloId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("IdFeature");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("RuoloId");
b.ToTable("Permission");
});
modelBuilder.Entity("TecniStamp.Domain.ProvinciaIstat", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<string>("Provincia")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Sigla")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("ProvinciaIstat");
});
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<Guid?>("IdUtenteCreazione")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("IdUtenteModifica")
.HasColumnType("uniqueidentifier");
b.Property<string>("Nome")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.ToTable("Ruolo");
});
modelBuilder.Entity("TecniStamp.Domain.Sezione", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<bool>("Blank")
.HasColumnType("bit");
b.Property<DateTime>("DataCreazione")
.HasColumnType("datetime2");
b.Property<DateTime?>("DataModifica")
.HasColumnType("datetime2");
b.Property<bool>("Eliminato")
.HasColumnType("bit");
b.Property<string>("Icona")
.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<int>("Ordinamento")
.HasColumnType("int");
b.Property<Guid?>("ParentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Url")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("ParentId");
b.ToTable("Sezione");
});
modelBuilder.Entity("TecniStamp.Domain.Utente", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Cognome")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Costo")
.HasColumnType("decimal(18,2)");
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<Guid?>("RuoloId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
b.HasIndex("IdUtenteModifica");
b.HasIndex("RuoloId");
b.ToTable("Utente");
});
modelBuilder.Entity("TecniStamp.Domain.Cliente", b =>
{
b.HasOne("TecniStamp.Domain.ComuneIstat", "Comune")
.WithMany()
.HasForeignKey("ComuneId");
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("Comune");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
{
b.HasOne("TecniStamp.Domain.Cliente", "Cliente")
.WithMany()
.HasForeignKey("ClienteId");
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("Cliente");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("TecniStamp.Domain.ProvinciaIstat", "ProvinciaIstat")
.WithMany()
.HasForeignKey("ProvinciaIstatId");
b.Navigation("ProvinciaIstat");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("TecniStamp.Domain.Sezione", "Sezione")
.WithMany("Features")
.HasForeignKey("SezioneId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Sezione");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Lavorazione", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Macchinario", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Permission", b =>
{
b.HasOne("TecniStamp.Domain.Feature", "Feature")
.WithMany()
.HasForeignKey("IdFeature")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("TecniStamp.Domain.Ruolo", "Ruolo")
.WithMany("Permessi")
.HasForeignKey("RuoloId");
b.Navigation("Feature");
b.Navigation("Ruolo");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.ProvinciaIstat", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Sezione", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("TecniStamp.Domain.Sezione", "Parent")
.WithMany()
.HasForeignKey("ParentId");
b.Navigation("Parent");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Utente", b =>
{
b.HasOne("TecniStamp.Domain.Utente", "UtenteCreazione")
.WithMany()
.HasForeignKey("IdUtenteCreazione");
b.HasOne("TecniStamp.Domain.Utente", "UtenteModifica")
.WithMany()
.HasForeignKey("IdUtenteModifica");
b.HasOne("TecniStamp.Domain.Ruolo", "Ruolo")
.WithMany("Utenti")
.HasForeignKey("RuoloId");
b.Navigation("Ruolo");
b.Navigation("UtenteCreazione");
b.Navigation("UtenteModifica");
});
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
{
b.Navigation("Permessi");
b.Navigation("Utenti");
});
modelBuilder.Entity("TecniStamp.Domain.Sezione", b =>
{
b.Navigation("Features");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TecniStamp.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class RimossoUsername : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Username",
table: "Utente");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Username",
table: "Utente",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
}
}
}

View File

@ -102,7 +102,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("Cliente", (string)null);
b.ToTable("Cliente");
});
modelBuilder.Entity("TecniStamp.Domain.Commessa", b =>
@ -167,7 +167,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("Commessa", (string)null);
b.ToTable("Commessa");
});
modelBuilder.Entity("TecniStamp.Domain.ComuneIstat", b =>
@ -226,7 +226,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("ProvinciaIstatId");
b.ToTable("ComuneIstat", (string)null);
b.ToTable("ComuneIstat");
});
modelBuilder.Entity("TecniStamp.Domain.Feature", b =>
@ -275,7 +275,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("SezioneId");
b.ToTable("Feature", (string)null);
b.ToTable("Feature");
});
modelBuilder.Entity("TecniStamp.Domain.Lavorazione", b =>
@ -327,7 +327,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("Lavorazione", (string)null);
b.ToTable("Lavorazione");
});
modelBuilder.Entity("TecniStamp.Domain.Macchinario", b =>
@ -376,7 +376,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("Macchinario", (string)null);
b.ToTable("Macchinario");
});
modelBuilder.Entity("TecniStamp.Domain.Permission", b =>
@ -416,7 +416,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("RuoloId");
b.ToTable("Permission", (string)null);
b.ToTable("Permission");
});
modelBuilder.Entity("TecniStamp.Domain.ProvinciaIstat", b =>
@ -454,7 +454,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("ProvinciaIstat", (string)null);
b.ToTable("ProvinciaIstat");
});
modelBuilder.Entity("TecniStamp.Domain.Ruolo", b =>
@ -488,7 +488,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("IdUtenteModifica");
b.ToTable("Ruolo", (string)null);
b.ToTable("Ruolo");
});
modelBuilder.Entity("TecniStamp.Domain.Sezione", b =>
@ -540,7 +540,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("ParentId");
b.ToTable("Sezione", (string)null);
b.ToTable("Sezione");
});
modelBuilder.Entity("TecniStamp.Domain.Utente", b =>
@ -586,10 +586,6 @@ namespace TecniStamp.Infrastructure.Migrations
b.Property<Guid?>("RuoloId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Username")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("IdUtenteCreazione");
@ -598,7 +594,7 @@ namespace TecniStamp.Infrastructure.Migrations
b.HasIndex("RuoloId");
b.ToTable("Utente", (string)null);
b.ToTable("Utente");
});
modelBuilder.Entity("TecniStamp.Domain.Cliente", b =>

View File

@ -30,6 +30,7 @@
<div class="page">
<Routes />
</div>
<RadzenDialog />
<RadzenNotification />
<RadzenContextMenu />

View File

@ -1,4 +1,7 @@
@inherits LayoutComponentBase
<RadzenComponents @rendermode="InteractiveAuto" />
<AuthorizeView>
<Authorized>
<header class="header">

View File

@ -117,6 +117,8 @@
/// usando lID dellutente autenticato.
/// </summary>
private async Task onUtenteSave()
{
try
{
var state = await _auth.GetAuthenticationStateAsync();
var idClaim = state.User.FindFirst("UserId")?.Value;
@ -142,6 +144,11 @@
await _managerService.UtenteService.Salva(model, Guid.Parse(idClaim));
_navManager.NavigateTo($"/Anagrafiche/Operatori/Modifica/{Model.Id}");
}
catch (Exception ex)
{
await _dialogService.Alert("Si è verificato un'errore", "Errore", new AlertOptions(){OkButtonText = "Continua"});
}
}
/// <summary>
/// Torna allelenco utenti senza applicare altre azioni.

View File

@ -96,12 +96,13 @@
return;
}
var model = await _managerService.RuoloService.RicercaPer(x => x.Id == Model.Id, solaLettura: false)
?? new Ruolo();
var model = Model.Id == Guid.Empty
? new Ruolo()
: await _managerService.RuoloService.RicercaPer(x => x.Id == Model.Id, solaLettura: false);
model = Model.Map(model);
await _managerService.UtenteService.Salva(model, Guid.Parse(idClaim));
await _managerService.RuoloService.Salva(model, Guid.Parse(idClaim));
_navManager.NavigateTo($"/Anagrafiche/ruoli/Modifica/{Model.Id}");
}
@ -110,6 +111,6 @@
/// </summary>
private void backToHome()
{
_navManager.NavigateTo("/Anagrafiche/Operatori");
_navManager.NavigateTo("/Anagrafiche/ruoli");
}
}

View File

@ -17,4 +17,9 @@ public class RuoloViewModel
Id = model.Id
};
}
public Ruolo Map(Ruolo model)
{
return model;
}
}

View File

@ -5,8 +5,6 @@ namespace TecniStamp.Model;
public class UserViewModel : BaseViewModel
{
public string Username { get; set; }
[Required(ErrorMessage = "L'email è obbligatoria")]
[EmailAddress(ErrorMessage = "Formato email non valido")]
public string Email { get; set; }
@ -38,7 +36,6 @@ public class UserViewModel : BaseViewModel
: new UserViewModel()
{
Id = model.Id,
Username = model.Username,
Email = model.Email,
Cognome = model.Cognome,
Nome = model.Nome,