ProvSuIscrizione
This commit is contained in:
@ -38,8 +38,8 @@
|
||||
<div class="row">
|
||||
<div class="col-4 mb-3">
|
||||
<RadzenFormField Text="Provincia" Variant="Variant.Flat" Style="width: 100%;">
|
||||
<RadzenDropDown @bind-Value="@iscrizione.Provincia" Style="width: 100%" TextProperty="" Placeholder="Seleziona la provincia"
|
||||
Data="@provinciaList" Size="ButtonSize.Small" />
|
||||
<RadzenDropDown TValue="Guid" @bind-Value="@iscrizione.Provincia" Style="width: 100%" TextProperty="Info" ValueProperty="Id" Placeholder="Seleziona la provincia"
|
||||
Data="@provList" Size="ButtonSize.Small" />
|
||||
</RadzenFormField>
|
||||
<ValidationMessage For="@(() => iscrizione.Provincia)" />
|
||||
</div>
|
||||
@ -155,11 +155,12 @@
|
||||
[SupplyParameterFromForm]
|
||||
private IscrizioneEventoViewModel iscrizione { get; set; } = new();
|
||||
private IEnumerable<string> comuneList { get; set; }
|
||||
private IEnumerable<string> provinciaList { get; set; }
|
||||
private IEnumerable<DestinazioneViewModel> destinazioniList { get; set; }
|
||||
private IEnumerable<LookupViewModel<Guid>> tipologiaList { get; set; }
|
||||
private IEnumerable<string> esperienzaList { get; set; }
|
||||
private IEnumerable<LookupViewModel<int>> ruoloList { get; set; }
|
||||
|
||||
private List<ProvinciaViewModel> provList { get; set; }
|
||||
|
||||
private bool presaVisionePrivacy { get; set; }
|
||||
private bool presaVisioneDatiPersonali { get; set; }
|
||||
@ -172,11 +173,14 @@
|
||||
var destinazioniIds = invito.IscrizioniEvento?.Select(x => x.DestinazioneId).ToList() ?? new List<Guid?>();
|
||||
destinazioniList = (await _managerService.DestinazioneService.RicercaQueryable(filtro: x => x.ClienteId == invito.ClienteId && !destinazioniIds.Any(y => y == x.Id))).Select(x => (DestinazioneViewModel)x).ToList();
|
||||
comuneList = new List<string>() { "Brescia" };
|
||||
provinciaList = new List<string>() { "BS" };
|
||||
esperienzaList = new List<string>() { "Si", "No" };
|
||||
tipologiaList = (await _managerService.TipologiaClienteService.RicercaQueryable(x => x.Eliminato == false, ordinamento: x => x.OrderBy(y => y.Nome)))
|
||||
.Select(x => new LookupViewModel<Guid>(x.Id, x.Nome)).ToList();
|
||||
ruoloList = eUtils.GetEnumList<RuoloTipo>();
|
||||
provList = (await _managerService.ProvinciaIstatService.RicercaQueryable(
|
||||
x => x.Eliminato == false,
|
||||
ordinamento: x => x.OrderBy(y => y.Provincia)))
|
||||
.Select(x => (ProvinciaViewModel)x).ToList();
|
||||
}
|
||||
|
||||
private async Task onIscrizioneSave()
|
||||
|
||||
@ -26,7 +26,7 @@ public class IscrizioneEventoViewModel
|
||||
[Required(ErrorMessage = "Il numero di telefono è obbigatorio")]
|
||||
public string NumeroTelefono { get; set; }
|
||||
[Required(ErrorMessage = "La provincia è obbigatoria")]
|
||||
public string Provincia { get; set; }
|
||||
public Guid Provincia { get; set; }
|
||||
[Required(ErrorMessage = "Il comune è obbigatorio")]
|
||||
public string Comune { get; set; }
|
||||
[Required(ErrorMessage = "Il CAP è obbigatorio")]
|
||||
@ -54,7 +54,7 @@ public class IscrizioneEventoViewModel
|
||||
model.Cognome = Cognome;
|
||||
model.Email = Email;
|
||||
model.NumeroTelefono = NumeroTelefono;
|
||||
model.Provincia = Provincia;
|
||||
/*model.Provincia = Provincia;*/
|
||||
model.Comune = Comune;
|
||||
model.Cap = Cap;
|
||||
model.RagioneSociale = RagioneSociale;
|
||||
@ -83,7 +83,7 @@ public class IscrizioneEventoViewModel
|
||||
Cognome = model.Cognome,
|
||||
Email = model.Email,
|
||||
NumeroTelefono = model.NumeroTelefono,
|
||||
Provincia = model.Provincia,
|
||||
Provincia = model.Provincia?.Id ?? Guid.Empty,
|
||||
Comune = model.Comune,
|
||||
Cap = model.Cap,
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
|
||||
@ -1,8 +1,23 @@
|
||||
namespace StandManager.Model;
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Model;
|
||||
|
||||
public class ProvinciaViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Sigla { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
public string Info => $"{Sigla} - {Provincia}";
|
||||
|
||||
public static implicit operator ProvinciaViewModel(ProvinciaIstat model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ProvinciaViewModel()
|
||||
{
|
||||
Provincia = model.Provincia,
|
||||
Sigla = model.Sigla,
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user