- Email obbligatorie + check
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
"AllowedHosts": "*",
|
||||
"EmailConfig": {
|
||||
"ServerAddress": "https://mailbridge.gruppodac.eu/api/graph/NewMessageHtml",
|
||||
"RangeSize": 3,
|
||||
"RangeSize": 20,
|
||||
"From": "registrazioni@gruppodac.eu",
|
||||
"MailSplitCharTo": ";",
|
||||
"To": "g.vitari@oaservice.it;d.sandrelli@oaservice.it",
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@profilo.Email" />
|
||||
<ValidationMessage For="@(() => profilo.Email)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -39,16 +39,19 @@
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Nome</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@utente.Nome" />
|
||||
<ValidationMessage For="@(() => utente.Nome)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Cognome</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@utente.Cognome" />
|
||||
<ValidationMessage For="@(() => utente.Cognome)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@utente.Email" />
|
||||
<ValidationMessage For="@(() => utente.Email)" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
|
||||
@ -76,6 +76,11 @@
|
||||
|
||||
private async Task OnIscrizioneSave()
|
||||
{
|
||||
if (!mail.Contains("@"))
|
||||
{
|
||||
await _dialogService.Alert("Inserire un indirizzo Email valido", "Errore", new ConfirmOptions() { OkButtonText = "Ok" });
|
||||
return;
|
||||
}
|
||||
var exist = await _managerService.MailQueueService.RicercaPer(x => x.ToList.Contains(mail) && !x.Eliminato);
|
||||
if (exist != null && exist?.Id != Guid.Empty)
|
||||
{
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using StandManager.Domain.Entita;
|
||||
using StandManager.Service.Mail;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@ -22,6 +23,7 @@ public class IscrizioneEventoViewModel
|
||||
[Required(ErrorMessage = "Il cognome è obbigatorio")]
|
||||
public string Cognome { get; set; }
|
||||
[Required(ErrorMessage = "La E-mail è obbigatoria")]
|
||||
[EmailAddress(ErrorMessage = "Inserisci un indirizzo email valido")]
|
||||
public string Email { get; set; }
|
||||
[Required(ErrorMessage = "Il numero di telefono è obbigatorio")]
|
||||
public string NumeroTelefono { get; set; }
|
||||
|
||||
@ -40,6 +40,7 @@ public class ProfiloViewModel
|
||||
{
|
||||
if (string.IsNullOrEmpty(Nome)) throw new ValidationException("Il nome inserito non è valido");
|
||||
if (string.IsNullOrEmpty(Cognome)) throw new ValidationException("Il cognome inserito non è valido");
|
||||
if (!Email.Contains("@")) throw new ValidationException("L'indirizzo mail inserito non è valido");
|
||||
if (!string.IsNullOrEmpty(Password) && string.IsNullOrEmpty(ConfirmPassword)) throw new Exception("E' necessario inserire la password di conferma");
|
||||
if (!string.IsNullOrEmpty(Password) && !string.IsNullOrEmpty(ConfirmPassword) && Password != ConfirmPassword)
|
||||
throw new ValidationException("Le due password non corrispondono");
|
||||
|
||||
@ -7,7 +7,7 @@ public class UtenteViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
[Required]
|
||||
[Required(ErrorMessage = "L'email è obbligatoria")]
|
||||
[EmailAddress(ErrorMessage = "Email non valida")]
|
||||
public string Email { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user