Fix creazione
This commit is contained in:
@ -4,6 +4,12 @@ namespace StandManager.Domain.Entita;
|
|||||||
|
|
||||||
public class Utente : EntitaBase
|
public class Utente : EntitaBase
|
||||||
{
|
{
|
||||||
|
public Utente()
|
||||||
|
{
|
||||||
|
DataCreazione = DateTime.Now;
|
||||||
|
Eliminato = false;
|
||||||
|
Username = string.Empty;
|
||||||
|
}
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
|
|||||||
@ -81,13 +81,16 @@
|
|||||||
public Guid? UserId { get; set; }
|
public Guid? UserId { get; set; }
|
||||||
|
|
||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
private UtenteViewModel? utente { get; set; }
|
private UtenteViewModel? utente { get; set; } = new();
|
||||||
|
|
||||||
private string pageTitle => utente?.Id == Guid.Empty ? "Nuovo utente" : "Modifica utente";
|
private string pageTitle => utente?.Id == Guid.Empty ? "Nuovo utente" : "Modifica utente";
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
utente ??= await _managerService.UtenteService.RicercaPer(x => x.Id == UserId);
|
if (UserId.GetValueOrDefault() != Guid.Empty)
|
||||||
|
utente = await _managerService.UtenteService.RicercaPer(x => x.Id == UserId);
|
||||||
|
else
|
||||||
|
utente = new UtenteViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task onUtenteSave()
|
private async Task onUtenteSave()
|
||||||
|
|||||||
Reference in New Issue
Block a user