@@ -36,12 +40,9 @@
+ DialogService.Confirm(GetMessage(), "MyTitle", new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "No" })) />
-
-
-
-
-
@@ -71,16 +72,29 @@
private async Task DeleteRow(Utente user)
{
-
+ var confirmationResult = await this.DialogService.Confirm("Are you sure?", "Dialog Title", new ConfirmOptions { OkButtonText = "Yes", CancelButtonText = "No" });
+ if (confirmationResult == true)
+ {
+ //Delete logic for id
+ }
+ // var ok = await dialog.Confirm($"Vuoi davvero eliminare l'utente {user.ToString()}?", "Conferma eliminazione", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
+
+ // if (ok == true)
+ // {
+ // // qui fai l’eliminazione vera
+ // //ASP
+ // // se serve:
+ // await InvokeAsync(StateHasChanged);
+ // }
}
- private async Task SaveRow(Utente user)
+ RenderFragment GetMessage()
{
-
- }
-
- private async Task CancelEdit(Utente user)
- {
-
+ return __builder =>
+ {
+
+ Are you sure?
+
+ };
}
}
diff --git a/StandManager/Components/Pages/Management/Utenti_Edit.razor b/StandManager/Components/Pages/Management/Utenti_Edit.razor
index d42121c..ae48bcc 100644
--- a/StandManager/Components/Pages/Management/Utenti_Edit.razor
+++ b/StandManager/Components/Pages/Management/Utenti_Edit.razor
@@ -59,7 +59,12 @@
-
+
+
+
+
@@ -117,4 +122,9 @@
await _managerService.UtenteService.Salva(model, Guid.Parse(idClaim));
_navManager.NavigateTo("/management/Utenti");
}
+
+ private void backToHome()
+ {
+ _navManager.NavigateTo("/management/Utenti");
+ }
}
diff --git a/StandManager/Model/UtenteViewModel.cs b/StandManager/Model/UtenteViewModel.cs
index ec66d51..4744cfc 100644
--- a/StandManager/Model/UtenteViewModel.cs
+++ b/StandManager/Model/UtenteViewModel.cs
@@ -7,13 +7,13 @@ namespace StandManager.Model
{
public Guid Id { get; set; }
public string Username { get; set; }
- //[Required]
- //[EmailAddress(ErrorMessage = "Email non valida")]
+ [Required]
+ [EmailAddress(ErrorMessage = "Email non valida")]
public string Email { get; set; }
public string Password { get; set; }
- //[Required(ErrorMessage ="Il nome è obbligatorio")]
+ [Required(ErrorMessage = "Il nome è obbligatorio")]
public string Nome { get; set; }
- //[Required(ErrorMessage = "Il cognome è obbligatorio")]
+ [Required(ErrorMessage = "Il cognome è obbligatorio")]
public string Cognome { get; set; }
public static implicit operator UtenteViewModel(Utente? model)