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