Prov/Citt
This commit is contained in:
13
StandManager/.config/dotnet-tools.json
Normal file
13
StandManager/.config/dotnet-tools.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "10.0.1",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
"rollForward": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -38,26 +38,39 @@
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Nome" @bind-Value="@destinazione.Cap" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Provincia</RadzenText>
|
||||
<RadzenDropDown TValue="Guid?" Data="provList" TextProperty="Description" ValueProperty="Key" Style="width: 100%" aria-label="Provincia" @bind-Value="@destinazione.ProvinceId" Change="onProvChanged"
|
||||
AllowFiltering="true"
|
||||
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
FilterOperator="StringFilterOperator.Contains"
|
||||
FilterPlaceholder="Cerca provincia..."/>
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Citta</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Cognome" @bind-Value="@destinazione.Citta" />
|
||||
<RadzenDropDown TValue="Guid?" Data="cittaList" TextProperty="Description" ValueProperty="Key" Style="width: 100%" aria-label="Provincia" @bind-Value="@destinazione.CittaId"
|
||||
AllowFiltering="true"
|
||||
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
|
||||
FilterOperator="StringFilterOperator.Contains"
|
||||
FilterPlaceholder="Cerca provincia..."/>
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Indirizzo</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.Indirizzo" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email di invito</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.EmailInvito" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Email di invito</RadzenText>
|
||||
<RadzenTextBox Style="width: 100%" aria-label="Email" @bind-Value="@destinazione.EmailInvito" />
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-3">
|
||||
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">Agente</RadzenText>
|
||||
<RadzenDropDown Style="width: 100%" TValue="Guid ?" @bind-Value=@destinazione.AgenteId Data=@agenti TextProperty="Info" ValueProperty="Id" Name="agenteDestDrop" Disabled="@(!canSetAgente)" />
|
||||
<RadzenDropDown Style="width: 100%" TValue="Guid?" @bind-Value=@destinazione.AgenteId Data=@agenti TextProperty="Info" ValueProperty="Id" Name="agenteDestDrop" Disabled="@(!canSetAgente)"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -84,6 +97,8 @@
|
||||
private DestinazioneViewModel destinazione { get; set; } = new();
|
||||
|
||||
private IEnumerable<UtenteViewModel> agenti { get; set; } = new List<UtenteViewModel>();
|
||||
public List<LookupViewModel<Guid>> provList { get; set; } = new();
|
||||
public List<LookupViewModel<Guid>> cittaList { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza il componente caricando l’elenco degli agenti non eliminati
|
||||
@ -97,8 +112,16 @@
|
||||
agenti = (await _managerService.UtenteService.RicercaQueryable(x => x.Eliminato == false && !x.IsCapoarea && x.CapoareaId == capoareaId, ordinamento: x => x.OrderBy(y => y.Cognome).ThenBy(z => z.Nome)))
|
||||
.Select(x => (UtenteViewModel)x).ToList();
|
||||
|
||||
destinazione = destinazioneId == Guid.Empty ? new() : await _managerService.DestinazioneService.RicercaPer(x => x.Id == destinazioneId,
|
||||
includi: x => x.Include(y =>y.Agente));
|
||||
destinazione = destinazioneId == Guid.Empty ? new() : await _managerService.DestinazioneService.RicercaPer(
|
||||
x => x.Id == destinazioneId,
|
||||
includi: x => x.Include(y =>y.Agente).Include(y => y.ComuneIstat).Include(y => y.ProvinciaIstat));
|
||||
|
||||
provList = (await _managerService.ProvinciaIstatService.RicercaQueryable(x => x.Eliminato == false))
|
||||
.Select(x => new LookupViewModel<Guid>(x.Id, x.Provincia)).ToList();
|
||||
cittaList = destinazione.ProvinceId.HasValue
|
||||
? (await _managerService.ComuneIstatService.RicercaQueryable(x => x.ProvinciaIstatId == destinazione.ProvinceId.GetValueOrDefault()))
|
||||
.Select(x => new LookupViewModel<Guid>(x.Id, x.Comune)).ToList()
|
||||
: new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -116,6 +139,9 @@
|
||||
if (destinazione.AgenteId.GetValueOrDefault() != Guid.Empty)
|
||||
model.Agente = await _managerService.UtenteService.RicercaPer(x => x.Id == destinazione.AgenteId);
|
||||
|
||||
model.ProvinciaIstatId = destinazione.ProvinceId;
|
||||
model.ComuneIstatId = destinazione.CittaId;
|
||||
|
||||
await _managerService.DestinazioneService.Salva(model, idClaim);
|
||||
_dialogService.Close(true);
|
||||
}
|
||||
@ -127,4 +153,10 @@
|
||||
{
|
||||
_dialogService.Close(true);
|
||||
}
|
||||
|
||||
private async Task onProvChanged(object value)
|
||||
{
|
||||
cittaList = (await _managerService.ComuneIstatService.RicercaQueryable(x => x.ProvinciaIstatId == destinazione.ProvinceId.GetValueOrDefault()))
|
||||
.Select(x => new LookupViewModel<Guid>(x.Id, x.Comune)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,6 @@
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@clienti" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.RagioneSociale)" Title="Ragione sociale" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Cliente.PartitaIva)" Title="Partita IVA" Width="250px" />
|
||||
<RadzenDataGridColumn Property="Agente.Info" Title="Agente" Width="250px" />
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@eventi" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.Titolo)" Title="Titolo" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataDa)" FormatString="{0:dd/MM/yyyy}" Title="Dal" Width="250px" />
|
||||
<RadzenDataGridColumn Property="@nameof(EventoViewModel.DataA)" FormatString="{0:dd/MM/yyyy}" Title="Al" Width="250px" />
|
||||
|
||||
@ -12,13 +12,13 @@
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="row row-cards">
|
||||
<div class="col-3">
|
||||
<div class="col-4">
|
||||
<Widget_Clienti senzaAgente="false"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-4">
|
||||
<Widget_Clienti senzaAgente="true"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="col-4">
|
||||
<Widget_Evento/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
@attribute [Authorize]
|
||||
@page "/management/Ruoli"
|
||||
@using ClosedXML.Excel
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using StandManager.Model
|
||||
@using System.Threading.Tasks
|
||||
|
||||
@rendermode InteractiveServer
|
||||
|
||||
@inject AuthenticationStateProvider auth
|
||||
|
||||
<PageTitle>Ruoli</PageTitle>
|
||||
|
||||
<div class="page-wrapper">
|
||||
@ -35,7 +30,6 @@
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@ruoli" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(RuoloViewModel.Id)" Filterable="false" Title="ID" Width="200px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(RuoloViewModel.Nome)" Title="Nome" Width="250px" />
|
||||
|
||||
<RadzenDataGridColumn Context="ruolo" Filterable="false" Sortable="false" TextAlign="TextAlign.Right" Width="250px">
|
||||
@ -89,7 +83,7 @@
|
||||
|
||||
if (ok == true)
|
||||
{
|
||||
await _managerService.RuoloService.Elimina(ruolo.Id, await MembershipUtils.GetUserId(auth));
|
||||
await _managerService.RuoloService.Elimina(ruolo.Id, await MembershipUtils.GetUserId(_auth));
|
||||
ruoli = (await _managerService.RuoloService.RicercaQueryable(x => x.Eliminato == false))
|
||||
.Select(x => (RuoloViewModel)x).ToList();
|
||||
}
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true"
|
||||
Data="@utenti" ColumnWidth="300px" LogicalFilterOperator="LogicalFilterOperator.Or" SelectionMode="DataGridSelectionMode.Single">
|
||||
<Columns>
|
||||
<RadzenDataGridColumn Property="@nameof(Utente.Id)" Filterable="false" Title="ID" Width="80px" TextAlign="TextAlign.Center" />
|
||||
<RadzenDataGridColumn Property="@nameof(Utente.Nome)" Title="Nome" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Utente.Cognome)" Title="Cognome" Width="160px" />
|
||||
<RadzenDataGridColumn Property="@nameof(Utente.Email)" Title="Mail" Width="200px" />
|
||||
|
||||
@ -17,7 +17,9 @@
|
||||
var clientiSenza = senzaAgente
|
||||
? await _managerService.ClienteService.RicercaQueryable(x => x.AgenteId == null)
|
||||
: await _managerService.ClienteService.RicercaQueryable(x => x.CapoareaId == null);
|
||||
totale = clientiSenza.Count();
|
||||
totale = clientiSenza == null
|
||||
? 0
|
||||
: clientiSenza.Count();
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
var nextEvent = await _managerService.EventoService.RicercaPer(x => x.DataDa >= DateTime.Now && x.Eliminato == false,
|
||||
includi:x => x.Include(y => y.InvitoEventoList), ordinamento:x => x.OrderBy(y => y.DataDa));
|
||||
totale = nextEvent.InvitoEventoList.Count();
|
||||
totale = nextEvent == null
|
||||
? 0
|
||||
: nextEvent.InvitoEventoList.Count();
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,8 @@ public class DestinazioneViewModel
|
||||
public string EmailInvito { get; set; }
|
||||
public string NumeroTelefono { get; set; }
|
||||
public Guid? AgenteId { get; set; }
|
||||
public Guid? ProvinceId { get; set; }
|
||||
public Guid? CittaId { get; set; }
|
||||
public string NomeAgente { get; set; }
|
||||
public UtenteViewModel Agente { get; set; }
|
||||
public List<ReferenteViewModel> Referenti { get; set; }
|
||||
@ -43,7 +45,9 @@ public class DestinazioneViewModel
|
||||
NumeroTelefono = model.NumeroTelefono,
|
||||
PartitaIva = model.PartitaIva,
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
Referenti = model.Referenti?.Select(x => (ReferenteViewModel)x).ToList() ?? new List<ReferenteViewModel>()
|
||||
Referenti = model.Referenti?.Select(x => (ReferenteViewModel)x).ToList() ?? new List<ReferenteViewModel>(),
|
||||
ProvinceId = model.ProvinciaIstatId,
|
||||
CittaId = model.ComuneIstatId
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user