Commesse
This commit is contained in:
13
TecniStamp/TecniStamp.Service/CommessaService.cs
Normal file
13
TecniStamp/TecniStamp.Service/CommessaService.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using OAService.Service.Servizi.Implementazioni;
|
||||
using TecniStamp.Domain;
|
||||
using TecniStamp.Service.Interfaces;
|
||||
using TecniStamp.Service.Repository;
|
||||
|
||||
namespace TecniStamp.Service;
|
||||
|
||||
public class CommessaService : TService<Commessa>, ICommessaService
|
||||
{
|
||||
public CommessaService(ITecniStampUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
using OAService.Service.Servizi.Interfacce;
|
||||
using TecniStamp.Domain;
|
||||
|
||||
namespace TecniStamp.Service.Interfaces;
|
||||
|
||||
public interface ICommessaService : ITService<Commessa>
|
||||
{
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
public interface IManagerService
|
||||
{
|
||||
ICommessaService CommessaService { get; set; }
|
||||
IFeatureService FeatureService { get; set; }
|
||||
IPermissionService PermissionService { get; set; }
|
||||
IRuoloService RuoloService{ get; set; }
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
using OAService.Service.Repository;
|
||||
using OAService.Service.Servizi.Interfacce;
|
||||
using TecniStamp.Domain;
|
||||
|
||||
|
||||
@ -4,15 +4,17 @@ namespace TecniStamp.Service;
|
||||
|
||||
public class ManagerService : IManagerService
|
||||
{
|
||||
public ManagerService(IUserService userService, ISezioneService sezioneService, IPermissionService permissionService, IRuoloService ruoloService, IFeatureService featureService)
|
||||
public ManagerService(IUserService userService, ISezioneService sezioneService, IPermissionService permissionService, IRuoloService ruoloService, IFeatureService featureService, ICommessaService commessaService)
|
||||
{
|
||||
UtenteService = userService;
|
||||
SezioneService = sezioneService;
|
||||
PermissionService = permissionService;
|
||||
RuoloService = ruoloService;
|
||||
FeatureService = featureService;
|
||||
CommessaService = commessaService;
|
||||
}
|
||||
|
||||
public ICommessaService CommessaService { get; set; }
|
||||
public IFeatureService FeatureService { get; set; }
|
||||
public IPermissionService PermissionService { get; set; }
|
||||
public IRuoloService RuoloService { get; set; }
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
@page "/commesse"
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using TecniStamp.Model.Commesse
|
||||
@using TecniStamp.Model.Common
|
||||
@using TecniStamp.Utils
|
||||
|
||||
@ -8,11 +9,15 @@
|
||||
|
||||
@code {
|
||||
public List<BreadcrumbViewModel> BreadcrumbList { get; set; } = new();
|
||||
public List<CommessaViewModel> CommesseList { get; set; } = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
BreadcrumbList = await BreadcrumbUtils.BuildBreadcrumbByFeature(_managerService, "Commesse_Info");
|
||||
|
||||
CommesseList = (await _managerService.CommessaService.RicercaQueryable(x => x.Eliminato == false))
|
||||
.Select(x => (CommessaViewModel)x).ToList();
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
<a class="stretched-link text-decoration-none text-dark" href="@Model.Url" @(Model.Blank ? "target=\"_blank\"" : "") ></a>
|
||||
<div class="card-body">
|
||||
<h1 class="text-center mb-2">
|
||||
<i class="@Model.Icon" style="font-size:65px;"></i>
|
||||
<RadzenIcon Icon="@Model.Icon" />
|
||||
</h1>
|
||||
<h1 class="mb-0 text-center">
|
||||
@Model.Text
|
||||
|
||||
50
TecniStamp/TecniStamp/Model/Commesse/ClienteViewModel.cs
Normal file
50
TecniStamp/TecniStamp/Model/Commesse/ClienteViewModel.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using TecniStamp.Domain;
|
||||
|
||||
namespace TecniStamp.Model.Commesse;
|
||||
|
||||
public class ClienteViewModel : BaseViewModel
|
||||
{
|
||||
public string RagioneSociale { get; set; }
|
||||
public string PartitaIva { get; set; }
|
||||
public string Paese { get; set; }
|
||||
public string Telefono { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Indirizzo { get; set; }
|
||||
public string CAP { get; set; }
|
||||
public string Citta { get; set; }
|
||||
public string NumeroCivico { get; set; }
|
||||
public string Via { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
public string Note { get; set; }
|
||||
public Guid? ComuneId { get; set; }
|
||||
public ComuneIstatViewModel Comune { get; set; }
|
||||
|
||||
public override void Validate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static implicit operator ClienteViewModel(Cliente model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ClienteViewModel()
|
||||
{
|
||||
RagioneSociale = model.RagioneSociale,
|
||||
PartitaIva = model.PartitaIva,
|
||||
Paese = model.Paese,
|
||||
Telefono = model.Telefono,
|
||||
Email = model.Email,
|
||||
Indirizzo = model.Indirizzo,
|
||||
CAP = model.CAP,
|
||||
Citta = model.Citta,
|
||||
NumeroCivico = model.NumeroCivico,
|
||||
Via = model.Via,
|
||||
Provincia = model.Provincia,
|
||||
Note = model.Note,
|
||||
ComuneId = model.ComuneId,
|
||||
Comune = model.Comune,
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
44
TecniStamp/TecniStamp/Model/Commesse/CommessaViewModel.cs
Normal file
44
TecniStamp/TecniStamp/Model/Commesse/CommessaViewModel.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using TecniStamp.Domain;
|
||||
|
||||
namespace TecniStamp.Model.Commesse;
|
||||
|
||||
public class CommessaViewModel : BaseViewModel
|
||||
{
|
||||
public string CodiceCommessa { get; set; }
|
||||
public int AnnoCommessa { get; set; }
|
||||
public Guid? ClienteId { get; set; }
|
||||
public ClienteViewModel Cliente { get; set; }
|
||||
public string RiferimentoCliente { get; set; }
|
||||
public string OrdineNr { get; set; }
|
||||
public decimal? OreTotali { get; set; }
|
||||
public DateTime DataOrdine { get; set; }
|
||||
public DateTime DataConsegnaPrevista { get; set; }
|
||||
public DateTime DataConsegna { get; set; }
|
||||
public CommessaStato Stato { get; set; }
|
||||
|
||||
public override void Validate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static implicit operator CommessaViewModel(Commessa model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new CommessaViewModel()
|
||||
{
|
||||
Stato = model.Stato,
|
||||
CodiceCommessa = model.CodiceCommessa,
|
||||
AnnoCommessa = model.AnnoCommessa,
|
||||
ClienteId = model.ClienteId,
|
||||
Cliente = model.Cliente,
|
||||
RiferimentoCliente = model.RiferimentoCliente,
|
||||
OrdineNr = model.OrdineNr,
|
||||
OreTotali = model.OreTotali,
|
||||
DataOrdine = model.DataOrdine,
|
||||
DataConsegnaPrevista = model.DataConsegnaPrevista,
|
||||
DataConsegna = model.DataConsegna,
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
35
TecniStamp/TecniStamp/Model/Commesse/ComuneIstatViewModel.cs
Normal file
35
TecniStamp/TecniStamp/Model/Commesse/ComuneIstatViewModel.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using TecniStamp.Domain;
|
||||
|
||||
namespace TecniStamp.Model.Commesse;
|
||||
|
||||
public class ComuneIstatViewModel : BaseViewModel
|
||||
{
|
||||
public string Istat { get; set; }
|
||||
public string Comune { get; set; }
|
||||
public string Regione { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
public string Prefisso { get; set; }
|
||||
public string CodFisco { get; set; }
|
||||
public ProvinciaIstatViewModel ProvinciaIstat { get; set; }
|
||||
public override void Validate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static implicit operator ComuneIstatViewModel(ComuneIstat model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ComuneIstatViewModel()
|
||||
{
|
||||
Provincia = model.Provincia,
|
||||
CodFisco = model.CodFisco,
|
||||
Prefisso = model.Prefisso,
|
||||
Regione = model.Regione,
|
||||
Istat = model.Istat,
|
||||
Comune = model.Comune,
|
||||
ProvinciaIstat = model.ProvinciaIstat,
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
using TecniStamp.Domain;
|
||||
|
||||
namespace TecniStamp.Model.Commesse;
|
||||
|
||||
public class ProvinciaIstatViewModel : BaseViewModel
|
||||
{
|
||||
public string Sigla { get; set; }
|
||||
public string Provincia { get; set; }
|
||||
|
||||
public override void Validate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static implicit operator ProvinciaIstatViewModel(ProvinciaIstat model)
|
||||
{
|
||||
return model == null
|
||||
? null
|
||||
: new ProvinciaIstatViewModel()
|
||||
{
|
||||
Provincia = model.Provincia,
|
||||
Sigla = model.Sigla,
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user