diff --git a/LiMan.DB/Controllers/LicManController.cs b/LiMan.DB/Controllers/LicManController.cs index a41d7e3..e5f9c17 100644 --- a/LiMan.DB/Controllers/LicManController.cs +++ b/LiMan.DB/Controllers/LicManController.cs @@ -1,4 +1,4 @@ -using LiMan.GLS.DatabaseModels; +using LiMan.DB.DatabaseModels; using Microsoft.Extensions.Configuration; using NLog; using System; @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace LiMan.GLS.Controllers +namespace LiMan.DB.Controllers { public class LicManController : IDisposable { diff --git a/LiMan.DB/DatabaseModels/AnagApplicazioni.cs b/LiMan.DB/DatabaseModels/AnagApplicazioni.cs index 9d16596..44ff0f4 100644 --- a/LiMan.DB/DatabaseModels/AnagApplicazioni.cs +++ b/LiMan.DB/DatabaseModels/AnagApplicazioni.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { public partial class AnagApplicazioni { diff --git a/LiMan.DB/DatabaseModels/AnagInstallazioni.cs b/LiMan.DB/DatabaseModels/AnagInstallazioni.cs index 5fce942..af1498a 100644 --- a/LiMan.DB/DatabaseModels/AnagInstallazioni.cs +++ b/LiMan.DB/DatabaseModels/AnagInstallazioni.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { // // This is here so CodeMaid doesn't reorganize this document diff --git a/LiMan.DB/DatabaseModels/LicManContext.cs b/LiMan.DB/DatabaseModels/LicManContext.cs index 82a847a..167a0b7 100644 --- a/LiMan.DB/DatabaseModels/LicManContext.cs +++ b/LiMan.DB/DatabaseModels/LicManContext.cs @@ -6,7 +6,7 @@ using NLog; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { public partial class LicManContext : DbContext { diff --git a/LiMan.DB/DatabaseModels/LicenzeAttive.cs b/LiMan.DB/DatabaseModels/LicenzeAttive.cs index f7519ef..b39fa1e 100644 --- a/LiMan.DB/DatabaseModels/LicenzeAttive.cs +++ b/LiMan.DB/DatabaseModels/LicenzeAttive.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { public partial class LicenzeAttive { diff --git a/LiMan.DB/DatabaseModels/Permessi.cs b/LiMan.DB/DatabaseModels/Permessi.cs index 4a07001..33ef1cd 100644 --- a/LiMan.DB/DatabaseModels/Permessi.cs +++ b/LiMan.DB/DatabaseModels/Permessi.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { public partial class Permessi { diff --git a/LiMan.DB/DatabaseModels/Permessi2Funzione.cs b/LiMan.DB/DatabaseModels/Permessi2Funzione.cs index 3657c95..9489562 100644 --- a/LiMan.DB/DatabaseModels/Permessi2Funzione.cs +++ b/LiMan.DB/DatabaseModels/Permessi2Funzione.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; #nullable disable -namespace LiMan.GLS.DatabaseModels +namespace LiMan.DB.DatabaseModels { public partial class Permessi2Funzione { diff --git a/LiMan.DB/Migrations/20211008094940_InitDb.Designer.cs b/LiMan.DB/Migrations/20211008094940_InitDb.Designer.cs index d5178c3..c38b0f5 100644 --- a/LiMan.DB/Migrations/20211008094940_InitDb.Designer.cs +++ b/LiMan.DB/Migrations/20211008094940_InitDb.Designer.cs @@ -1,13 +1,13 @@ // using System; -using LiMan.GLS.DatabaseModels; +using LiMan.DB.DatabaseModels; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace LiMan.GLS.Migrations +namespace LiMan.DB.Migrations { [DbContext(typeof(LicManContext))] [Migration("20211008094940_InitDb")] @@ -22,7 +22,7 @@ namespace LiMan.GLS.Migrations .HasAnnotation("ProductVersion", "5.0.10") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagApplicazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagApplicazioni", b => { b.Property("Applicativo") .HasMaxLength(50) @@ -39,7 +39,7 @@ namespace LiMan.GLS.Migrations b.ToTable("AnagApplicazioni"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagInstallazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagInstallazioni", b => { b.Property("Installazione") .HasMaxLength(50) @@ -66,7 +66,7 @@ namespace LiMan.GLS.Migrations b.ToTable("AnagInstallazioni"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.LicenzeAttive", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.LicenzeAttive", b => { b.Property("IdxLic") .ValueGeneratedOnAdd() @@ -120,7 +120,7 @@ namespace LiMan.GLS.Migrations b.ToTable("LicenzeAttive"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi", b => { b.Property("CodPermesso") .HasMaxLength(50) @@ -160,7 +160,7 @@ namespace LiMan.GLS.Migrations b.ToTable("Permessi"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi2Funzione", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi2Funzione", b => { b.Property("CodPermesso") .HasMaxLength(50) @@ -185,14 +185,14 @@ namespace LiMan.GLS.Migrations b.ToTable("Permessi2Funzione"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.LicenzeAttive", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.LicenzeAttive", b => { - b.HasOne("LiMan.GLS.DatabaseModels.AnagApplicazioni", "ApplicativoNavigation") + b.HasOne("LiMan.DB.DatabaseModels.AnagApplicazioni", "ApplicativoNavigation") .WithMany("LicenzeAttives") .HasForeignKey("Applicativo") .HasConstraintName("FK_AnagKeyValue_AnagApplicazioni"); - b.HasOne("LiMan.GLS.DatabaseModels.AnagInstallazioni", "InstallazioneNavigation") + b.HasOne("LiMan.DB.DatabaseModels.AnagInstallazioni", "InstallazioneNavigation") .WithMany("LicenzeAttives") .HasForeignKey("Installazione") .HasConstraintName("FK_AnagKeyValue_AnagInstallazioni"); @@ -202,9 +202,9 @@ namespace LiMan.GLS.Migrations b.Navigation("InstallazioneNavigation"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi2Funzione", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi2Funzione", b => { - b.HasOne("LiMan.GLS.DatabaseModels.Permessi", "CodPermessoNavigation") + b.HasOne("LiMan.DB.DatabaseModels.Permessi", "CodPermessoNavigation") .WithMany("Permessi2Funziones") .HasForeignKey("CodPermesso") .HasConstraintName("FK_Permessi2Funzione_Permessi") @@ -213,17 +213,17 @@ namespace LiMan.GLS.Migrations b.Navigation("CodPermessoNavigation"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagApplicazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagApplicazioni", b => { b.Navigation("LicenzeAttives"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagInstallazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagInstallazioni", b => { b.Navigation("LicenzeAttives"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi", b => { b.Navigation("Permessi2Funziones"); }); diff --git a/LiMan.DB/Migrations/20211008094940_InitDb.cs b/LiMan.DB/Migrations/20211008094940_InitDb.cs index 451dbaf..102af8e 100644 --- a/LiMan.DB/Migrations/20211008094940_InitDb.cs +++ b/LiMan.DB/Migrations/20211008094940_InitDb.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; -namespace LiMan.GLS.Migrations +namespace LiMan.DB.Migrations { public partial class InitDb : Migration { diff --git a/LiMan.DB/Migrations/LicManContextModelSnapshot.cs b/LiMan.DB/Migrations/LicManContextModelSnapshot.cs index d8bdc29..f231b76 100644 --- a/LiMan.DB/Migrations/LicManContextModelSnapshot.cs +++ b/LiMan.DB/Migrations/LicManContextModelSnapshot.cs @@ -1,12 +1,12 @@ // using System; -using LiMan.GLS.DatabaseModels; +using LiMan.DB.DatabaseModels; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace LiMan.GLS.Migrations +namespace LiMan.DB.Migrations { [DbContext(typeof(LicManContext))] partial class LicManContextModelSnapshot : ModelSnapshot @@ -20,7 +20,7 @@ namespace LiMan.GLS.Migrations .HasAnnotation("ProductVersion", "5.0.10") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagApplicazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagApplicazioni", b => { b.Property("Applicativo") .HasMaxLength(50) @@ -37,7 +37,7 @@ namespace LiMan.GLS.Migrations b.ToTable("AnagApplicazioni"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagInstallazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagInstallazioni", b => { b.Property("Installazione") .HasMaxLength(50) @@ -64,7 +64,7 @@ namespace LiMan.GLS.Migrations b.ToTable("AnagInstallazioni"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.LicenzeAttive", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.LicenzeAttive", b => { b.Property("IdxLic") .ValueGeneratedOnAdd() @@ -118,7 +118,7 @@ namespace LiMan.GLS.Migrations b.ToTable("LicenzeAttive"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi", b => { b.Property("CodPermesso") .HasMaxLength(50) @@ -158,7 +158,7 @@ namespace LiMan.GLS.Migrations b.ToTable("Permessi"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi2Funzione", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi2Funzione", b => { b.Property("CodPermesso") .HasMaxLength(50) @@ -183,14 +183,14 @@ namespace LiMan.GLS.Migrations b.ToTable("Permessi2Funzione"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.LicenzeAttive", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.LicenzeAttive", b => { - b.HasOne("LiMan.GLS.DatabaseModels.AnagApplicazioni", "ApplicativoNavigation") + b.HasOne("LiMan.DB.DatabaseModels.AnagApplicazioni", "ApplicativoNavigation") .WithMany("LicenzeAttives") .HasForeignKey("Applicativo") .HasConstraintName("FK_AnagKeyValue_AnagApplicazioni"); - b.HasOne("LiMan.GLS.DatabaseModels.AnagInstallazioni", "InstallazioneNavigation") + b.HasOne("LiMan.DB.DatabaseModels.AnagInstallazioni", "InstallazioneNavigation") .WithMany("LicenzeAttives") .HasForeignKey("Installazione") .HasConstraintName("FK_AnagKeyValue_AnagInstallazioni"); @@ -200,9 +200,9 @@ namespace LiMan.GLS.Migrations b.Navigation("InstallazioneNavigation"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi2Funzione", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi2Funzione", b => { - b.HasOne("LiMan.GLS.DatabaseModels.Permessi", "CodPermessoNavigation") + b.HasOne("LiMan.DB.DatabaseModels.Permessi", "CodPermessoNavigation") .WithMany("Permessi2Funziones") .HasForeignKey("CodPermesso") .HasConstraintName("FK_Permessi2Funzione_Permessi") @@ -211,17 +211,17 @@ namespace LiMan.GLS.Migrations b.Navigation("CodPermessoNavigation"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagApplicazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagApplicazioni", b => { b.Navigation("LicenzeAttives"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.AnagInstallazioni", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.AnagInstallazioni", b => { b.Navigation("LicenzeAttives"); }); - modelBuilder.Entity("LiMan.GLS.DatabaseModels.Permessi", b => + modelBuilder.Entity("LiMan.DB.DatabaseModels.Permessi", b => { b.Navigation("Permessi2Funziones"); }); diff --git a/LiMan.GLS/Controllers/LicManController.cs b/LiMan.GLS/Controllers/LicManController.cs index a41d7e3..af7d55a 100644 --- a/LiMan.GLS/Controllers/LicManController.cs +++ b/LiMan.GLS/Controllers/LicManController.cs @@ -1,4 +1,5 @@ using LiMan.GLS.DatabaseModels; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using NLog; using System; @@ -89,6 +90,104 @@ namespace LiMan.GLS.Controllers return dbResult; } + public List GetLicenzeFilt(bool OnlyActive, string Appl, string Inst) + { + List dbResult = new List(); + using (LicManContext localDbCtx = new LicManContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetLicenzeAttive + .Where(x => (x.Applicativo == Appl || string.IsNullOrEmpty(Appl)) && (x.Installazione == Inst || string.IsNullOrEmpty(Inst)) && (!OnlyActive || x.Scadenza > oggi)) + .OrderByDescending(o => o.Scadenza) + .ToList(); + } + return dbResult; + } + + /// + /// Annulla modifiche su una specifica entity (cancel update) + /// + /// + /// + public bool rollBackEntity(object item) + { + bool answ = false; + using (LicManContext localDbCtx = new LicManContext(_configuration)) + { + try + { + if (localDbCtx.Entry(item).State == EntityState.Deleted || localDbCtx.Entry(item).State == EntityState.Modified) + { + localDbCtx.Entry(item).Reload(); + } + } + catch (Exception exc) + { + Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}"); + } + } + return answ; + } + + public bool UpdateApplicazioni(AnagApplicazioni updItem) + { + bool done = false; + using (LicManContext localDbCtx = new LicManContext(_configuration)) + { + try + { + AnagApplicazioni currData = localDbCtx + .DbSetApplicazioni + .Where(x => x.Applicativo == updItem.Applicativo) + .FirstOrDefault(); + if (currData != null) + { + // aggiorno valori + currData.Descrizione = updItem.Descrizione; + localDbCtx.Entry(currData).State = EntityState.Modified; + localDbCtx.SaveChanges(); + } + done = true; + } + catch (Exception exc) + { + Log.Error($"Eccezione in UpdateApplicazioni:{Environment.NewLine}{exc}"); + } + } + return done; + } + + public bool UpdateInstallazioni(AnagInstallazioni updItem) + { + bool done = false; + using (LicManContext localDbCtx = new LicManContext(_configuration)) + { + try + { + AnagInstallazioni currData = localDbCtx + .DbSetInstallazioni + .Where(x => x.Installazione == updItem.Installazione) + .FirstOrDefault(); + if (currData != null) + { + // aggiorno valori + currData.Contatto = updItem.Contatto; + currData.Descrizione = updItem.Descrizione; + currData.Email = updItem.Email; + localDbCtx.Entry(currData).State = EntityState.Modified; + localDbCtx.SaveChanges(); + } + done = true; + } + catch (Exception exc) + { + Log.Error($"Eccezione in UpdateApplicazioni:{Environment.NewLine}{exc}"); + } + } + return done; + } + #endregion Public Methods } } \ No newline at end of file diff --git a/LiMan.GLS/DatabaseModels/LicManContext.cs b/LiMan.GLS/DatabaseModels/LicManContext.cs index 9b818b7..dffb75b 100644 --- a/LiMan.GLS/DatabaseModels/LicManContext.cs +++ b/LiMan.GLS/DatabaseModels/LicManContext.cs @@ -71,7 +71,7 @@ namespace LiMan.GLS.DatabaseModels { if (!optionsBuilder.IsConfigured) { - string connString = _configuration.GetConnectionString("LiMan.DB"); + string connString = _configuration.GetConnectionString("LiMan.GLS"); if (!string.IsNullOrEmpty(connString)) { optionsBuilder.UseSqlServer(connString); diff --git a/LiMan.Serv/LiMan.Serv.csproj b/LiMan.Serv/LiMan.Serv.csproj index 84892a4..17f70a4 100644 --- a/LiMan.Serv/LiMan.Serv.csproj +++ b/LiMan.Serv/LiMan.Serv.csproj @@ -9,6 +9,7 @@ + \ No newline at end of file diff --git a/LiMan.UI/Components/DataPager.razor b/LiMan.UI/Components/DataPager.razor index 3d577d1..619e271 100644 --- a/LiMan.UI/Components/DataPager.razor +++ b/LiMan.UI/Components/DataPager.razor @@ -1,5 +1,5 @@ 
-
+
@if (totalCount > 0) @@ -29,7 +29,7 @@
-
+
@if (!showLoading) diff --git a/LiMan.UI/Components/EditApplicazioni.razor b/LiMan.UI/Components/EditApplicazioni.razor new file mode 100644 index 0000000..0e9519e --- /dev/null +++ b/LiMan.UI/Components/EditApplicazioni.razor @@ -0,0 +1,40 @@ +@using LiMan.UI.Components +@using Microsoft.AspNetCore.Components.Authorization +@using LiMan.UI.Data +@using Microsoft.Extensions.Configuration + +
+
+ Modifica +
+
+ + +
+
+
+
+

@_currItem.Applicativo

+
+
+
+
+ + Descrizione + +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/LiMan.UI/Components/EditApplicazioni.razor.cs b/LiMan.UI/Components/EditApplicazioni.razor.cs new file mode 100644 index 0000000..a780a82 --- /dev/null +++ b/LiMan.UI/Components/EditApplicazioni.razor.cs @@ -0,0 +1,115 @@ +using LiMan.GLS.DatabaseModels; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Components +{ + public partial class EditApplicazioni + { + #region Protected Fields + + protected AnagApplicazioni _currItem = new AnagApplicazioni(); + + #endregion Protected Fields + + #region Private Properties + + [Inject] + private IJSRuntime JSRuntime { get; set; } + + [Inject] + private NavigationManager NavManager { get; set; } + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected LiManDataService DataService { get; set; } + + protected bool editAll + { + get + { + bool answ = false; + var currMode = GetQueryParm("currMode"); + if (!string.IsNullOrEmpty(currMode)) + { + answ = currMode.Equals("debug"); + } + return answ; + } + } + + [Inject] + protected MessageService MessageService { get; set; } + + #endregion Protected Properties + + #region Public Properties + + [Parameter] + public AnagApplicazioni currItem + { + get + { + return _currItem; + } + set + { + _currItem = value; + } + } + + [Parameter] + public EventCallback DataReset { get; set; } + + [Parameter] + public EventCallback DataUpdated { get; set; } + + #endregion Public Properties + + #region Private Methods + + private async Task cancelUpdate() + { + await DataReset.InvokeAsync(0); + } + + private async Task saveUpdate() + { + if (_currItem != null) + { + await DataService.ApplicazioniUpdate(_currItem); + await DataUpdated.InvokeAsync(0); + } + else + { + Console.WriteLine("Record null!"); + } + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// Blazor: get query parm from the URL + /// + /// + /// + protected string GetQueryParm(string parmName) + { + var uriBuilder = new UriBuilder(NavManager.Uri); + var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query); + return q[parmName] ?? ""; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/Components/EditInstallazioni.razor b/LiMan.UI/Components/EditInstallazioni.razor new file mode 100644 index 0000000..6e43567 --- /dev/null +++ b/LiMan.UI/Components/EditInstallazioni.razor @@ -0,0 +1,60 @@ +@using LiMan.UI.Components +@using Microsoft.AspNetCore.Components.Authorization +@using LiMan.UI.Data +@using Microsoft.Extensions.Configuration + +
+
+ Modifica +
+
+ + +
+
+
+
+ @_currItem.Installazione +
+
+
+
+ + Descrizione + +
+ +
+
+
+
+
+ + Contatto + +
+ +
+
+
+
+
+ + Email + +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/LiMan.UI/Components/EditInstallazioni.razor.cs b/LiMan.UI/Components/EditInstallazioni.razor.cs new file mode 100644 index 0000000..f8d5e25 --- /dev/null +++ b/LiMan.UI/Components/EditInstallazioni.razor.cs @@ -0,0 +1,115 @@ +using LiMan.GLS.DatabaseModels; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Components +{ + public partial class EditInstallazioni + { + #region Protected Fields + + protected AnagInstallazioni _currItem = new AnagInstallazioni(); + + #endregion Protected Fields + + #region Private Properties + + [Inject] + private IJSRuntime JSRuntime { get; set; } + + [Inject] + private NavigationManager NavManager { get; set; } + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected LiManDataService DataService { get; set; } + + protected bool editAll + { + get + { + bool answ = false; + var currMode = GetQueryParm("currMode"); + if (!string.IsNullOrEmpty(currMode)) + { + answ = currMode.Equals("debug"); + } + return answ; + } + } + + [Inject] + protected MessageService MessageService { get; set; } + + #endregion Protected Properties + + #region Public Properties + + [Parameter] + public AnagInstallazioni currItem + { + get + { + return _currItem; + } + set + { + _currItem = value; + } + } + + [Parameter] + public EventCallback DataReset { get; set; } + + [Parameter] + public EventCallback DataUpdated { get; set; } + + #endregion Public Properties + + #region Private Methods + + private async Task cancelUpdate() + { + await DataReset.InvokeAsync(0); + } + + private async Task saveUpdate() + { + if (_currItem != null) + { + await DataService.InstallazioniUpdate(_currItem); + await DataUpdated.InvokeAsync(0); + } + else + { + Console.WriteLine("Record null!"); + } + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// Blazor: get query parm from the URL + /// + /// + /// + protected string GetQueryParm(string parmName) + { + var uriBuilder = new UriBuilder(NavManager.Uri); + var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query); + return q[parmName] ?? ""; + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/Components/ListApplicazioni.razor b/LiMan.UI/Components/ListApplicazioni.razor new file mode 100644 index 0000000..7038a47 --- /dev/null +++ b/LiMan.UI/Components/ListApplicazioni.razor @@ -0,0 +1,70 @@ +@using LiMan.UI.Components + +
+
+

Applicazioni

+
+
+ @if (currRecord != null) + { + + } + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { +
+
+ + + + + + + + + + @foreach (var record in ListRecords) + { + + + + + + } + +
ApplicazioneDescrizione
+ @if (currRecord == null) + { + if (!record.Applicativo.StartsWith("_")) + { + + } + } + else + { + + } + + @record.Applicativo + +
@record.Descrizione
+
+
+
+ } +
+ +
\ No newline at end of file diff --git a/LiMan.UI/Components/ListApplicazioni.razor.cs b/LiMan.UI/Components/ListApplicazioni.razor.cs new file mode 100644 index 0000000..8c63897 --- /dev/null +++ b/LiMan.UI/Components/ListApplicazioni.razor.cs @@ -0,0 +1,162 @@ +using LiMan.GLS.DatabaseModels; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Components +{ + public partial class ListApplicazioni : ComponentBase, IDisposable + { + #region Private Fields + + private AnagApplicazioni currRecord = null; + private List ListRecords; + private List SearchRecords; + + #endregion Private Fields + + #region Protected Fields + + protected int totalCount = 0; + + #endregion Protected Fields + + #region Private Properties + + private int currPage + { + get + { + return AppMService.PageNum; + } + set + { + AppMService.PageNum = value; + } + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get + { + return AppMService.PageSize; + } + set + { + AppMService.PageSize = value; + } + } + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected MessageService AppMService { get; set; } + + [Inject] + protected LiManDataService DataService { get; set; } + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + protected bool showCamera { get; set; } = false; + + #endregion Protected Properties + + #region Private Methods + + private async Task fullReload() + { + currRecord = null; + await DataService.InvalidateAllCache(); + await ReloadAllData(); + } + + private async Task ReloadAllData() + { + isLoading = true; + await Task.Delay(1); + //ListRecords = null; + SearchRecords = await DataService.ApplicazioniGetAll(); + totalCount = SearchRecords.Count(); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + isLoading = false; + } + + #endregion Private Methods + + #region Protected Methods + + protected void Edit(AnagApplicazioni selRecord) + { + currRecord = selRecord; + } + + protected override async Task OnInitializedAsync() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Applicazioni"; + AppMService.PageIcon = "fas fa-gas-pump pr-2"; + await ReloadAllData(); + } + + protected async Task PagerReloadNum(int newNum) + { + numRecord = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected async Task PagerReloadPage(int newNum) + { + currPage = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected async Task ResetData() + { + await fullReload(); + } + + protected async Task UpdateData() + { + await fullReload(); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(string Applicativo) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.Applicativo == Applicativo) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/Components/ListInstallazioni.razor b/LiMan.UI/Components/ListInstallazioni.razor new file mode 100644 index 0000000..f4c9346 --- /dev/null +++ b/LiMan.UI/Components/ListInstallazioni.razor @@ -0,0 +1,78 @@ +@using LiMan.UI.Components + +
+
+

Installazioni

+
+
+ @if (currRecord != null) + { + + } + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { +
+
+ + + + + + + + + + + + @foreach (var record in ListRecords) + { + + + + + + + + } + +
InstallazioneDescrizioneContattoEmail
+ @if (currRecord == null) + { + if (!record.Installazione.StartsWith("_")) + { + + } + } + else + { + + } + + @record.Installazione + +
@record.Descrizione
+
+
@record.Contatto
+
+
@record.Email
+
+
+
+ } +
+ +
\ No newline at end of file diff --git a/LiMan.UI/Components/ListInstallazioni.razor.cs b/LiMan.UI/Components/ListInstallazioni.razor.cs new file mode 100644 index 0000000..a607de1 --- /dev/null +++ b/LiMan.UI/Components/ListInstallazioni.razor.cs @@ -0,0 +1,162 @@ +using LiMan.GLS.DatabaseModels; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Components +{ + public partial class ListInstallazioni : ComponentBase, IDisposable + { + #region Private Fields + + private AnagInstallazioni currRecord = null; + private List ListRecords; + private List SearchRecords; + + #endregion Private Fields + + #region Protected Fields + + protected int totalCount = 0; + + #endregion Protected Fields + + #region Private Properties + + private int currPage + { + get + { + return AppMService.PageNum; + } + set + { + AppMService.PageNum = value; + } + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get + { + return AppMService.PageSize; + } + set + { + AppMService.PageSize = value; + } + } + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected MessageService AppMService { get; set; } + + [Inject] + protected LiManDataService DataService { get; set; } + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + protected bool showCamera { get; set; } = false; + + #endregion Protected Properties + + #region Private Methods + + private async Task fullReload() + { + currRecord = null; + await DataService.InvalidateAllCache(); + await ReloadAllData(); + } + + private async Task ReloadAllData() + { + isLoading = true; + await Task.Delay(1); + //ListRecords = null; + SearchRecords = await DataService.InstallazioniGetAll(); + totalCount = SearchRecords.Count(); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + isLoading = false; + } + + #endregion Private Methods + + #region Protected Methods + + protected void Edit(AnagInstallazioni selRecord) + { + currRecord = selRecord; + } + + protected override async Task OnInitializedAsync() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Installazioni"; + AppMService.PageIcon = "fas fa-gas-pump pr-2"; + await ReloadAllData(); + } + + protected async Task PagerReloadNum(int newNum) + { + numRecord = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected async Task PagerReloadPage(int newNum) + { + currPage = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected async Task ResetData() + { + await fullReload(); + } + + protected async Task UpdateData() + { + await fullReload(); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(string Installazione) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.Installazione == Installazione) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/Components/ListLicenze.razor b/LiMan.UI/Components/ListLicenze.razor new file mode 100644 index 0000000..5c0893e --- /dev/null +++ b/LiMan.UI/Components/ListLicenze.razor @@ -0,0 +1,138 @@ +@using LiMan.UI.Components +
+
+
+
+

Licenze

+
+
+
+
+
+
+ + Installazione + +
+ +
+
+
+
+
+ + Applicazione + +
+ +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ @if (currRecord != null) + { + @**@ + } + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { +
+
+ + + + + + + + + + + + + + @foreach (var record in ListRecords) + { + + + + + + + + + + } + +
InstallazioneApplicativoScadenzaNum LicenzeCodice LicenzaDescrizione
+ @if (currRecord == null) + { + + } + else + { + + } + + @record.Installazione + + @record.Applicativo + + @($"{record.Scadenza:yyyy.MM.dd}") + +
@record.NumLicenze
+
+
@record.Licenza
+
+
@record.Descrizione
+
+
+
+ } +
+ +
\ No newline at end of file diff --git a/LiMan.UI/Components/ListLicenze.razor.cs b/LiMan.UI/Components/ListLicenze.razor.cs new file mode 100644 index 0000000..8138b7e --- /dev/null +++ b/LiMan.UI/Components/ListLicenze.razor.cs @@ -0,0 +1,248 @@ +using LiMan.GLS.DatabaseModels; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Components +{ + public partial class ListLicenze : ComponentBase, IDisposable + { + #region Private Fields + + private LicenzeAttive currRecord = null; + + private List ListApp; + private List ListInstall; + private List ListRecords; + private List SearchRecords; + + #endregion Private Fields + + #region Protected Fields + + protected int totalCount = 0; + + #endregion Protected Fields + + #region Private Properties + + private int currPage + { + get + { + return AppMService.PageNum; + } + set + { + AppMService.PageNum = value; + } + } + + private bool isLoading { get; set; } = false; + + private int numRecord + { + get + { + return AppMService.PageSize; + } + set + { + AppMService.PageSize = value; + } + } + + private bool OnlyActive + { + get + { + bool answ = false; + if (AppMService.DetailGLSFilter != null) + { + answ = AppMService.DetailGLSFilter.OnlyActive; + } + return answ; + } + set + { + if (!AppMService.DetailGLSFilter.OnlyActive.Equals(value)) + { + AppMService.DetailGLSFilter.OnlyActive = value; + var pUpd = Task.Run(async () => await ReloadAllData()); + pUpd.Wait(); + } + } + } + + private string SelApp + { + get + { + string answ = ""; + if (AppMService.DetailGLSFilter != null) + { + answ = AppMService.DetailGLSFilter.ApplicazioneSel; + } + return answ; + } + set + { + if (!AppMService.DetailGLSFilter.ApplicazioneSel.Equals(value)) + { + AppMService.DetailGLSFilter.ApplicazioneSel = value; + var pUpd = Task.Run(async () => await ReloadAllData()); + pUpd.Wait(); + } + } + } + + private string SelInst + { + get + { + string answ = ""; + if (AppMService.DetailGLSFilter != null) + { + answ = AppMService.DetailGLSFilter.InstallazioneSel; + } + return answ; + } + set + { + if (!AppMService.DetailGLSFilter.InstallazioneSel.Equals(value)) + { + AppMService.DetailGLSFilter.InstallazioneSel = value; + var pUpd = Task.Run(async () => await ReloadAllData()); + pUpd.Wait(); + } + } + } + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected MessageService AppMService { get; set; } + + [Inject] + protected LiManDataService DataService { get; set; } + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + protected bool showCamera { get; set; } = false; + + #endregion Protected Properties + + #region Private Methods + + private async Task ReloadAllData() + { + isLoading = true; + ListRecords = null; + ListApp = await DataService.ApplicazioniGetAll(); + ListInstall = await DataService.InstallazioniGetAll(); + await Task.Delay(1); + SearchRecords = await DataService.LicenzeGetFilt(AppMService.DetailGLSFilter); + totalCount = SearchRecords.Count(); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + isLoading = false; + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// formatta testo secondo scadenza: + /// scadenza > 60gg --> verde + /// 0 < scadenza < 60 gg --> giallo + /// scadenza < 0 --> rosso + /// + /// + /// + protected string cssScadenza(DateTime scadenza) + { + string answ = "text-dark"; + double periodo = scadenza.Subtract(DateTime.Today).TotalDays; + if (periodo > 60) + { + answ = "text-success"; + } + else if (periodo > 0) + { + answ = "text-warning"; + } + else + { + answ = "text-danger"; + } + + return answ; + } + + protected void Edit(LicenzeAttive selRecord) + { + currRecord = selRecord; + } + + protected override async Task OnInitializedAsync() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Licenze"; + AppMService.PageIcon = "fas fa-gas-pump pr-2"; + await ReloadAllData(); + } + + protected async Task PagerReloadNum(int newNum) + { + numRecord = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected async Task PagerReloadPage(int newNum) + { + currPage = newNum; + await ReloadAllData(); + isLoading = false; + } + + protected void ResetData() + { + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(int IdxLic) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.IdxLic == IdxLic) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index 95ece38..410b389 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -46,7 +46,9 @@ namespace LiMan.UI.Data #region Public Fields - public static LiMan.GLS.Controllers.LicManController dbController; + public static LiMan.GLS.Controllers.LicManController dbControllerGLS; + + public static LiMan.DB.Controllers.LicManController dbControllerNext; #endregion Public Fields @@ -60,15 +62,17 @@ namespace LiMan.UI.Data this.memoryCache = memoryCache; this.distributedCache = distributedCache; // conf DB - string connStr = _configuration.GetConnectionString("LiMan.DB"); - if (string.IsNullOrEmpty(connStr)) + string connStrGLS = _configuration.GetConnectionString("LiMan.GLS"); + string connStrDB = _configuration.GetConnectionString("LiMan.DB"); + if (string.IsNullOrEmpty(connStrDB) || string.IsNullOrEmpty(connStrGLS)) { - _logger.LogError("ConnString empty!"); + _logger.LogError("Almost one ConnString empty!"); } else { - dbController = new LiMan.GLS.Controllers.LicManController(configuration); - _logger.LogInformation("DbController OK"); + dbControllerGLS = new LiMan.GLS.Controllers.LicManController(configuration); + dbControllerNext = new LiMan.DB.Controllers.LicManController(configuration); + _logger.LogInformation("DbControllers OK"); } } @@ -122,7 +126,7 @@ namespace LiMan.UI.Data { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - dbResult = dbController.GetApplicazioni(); + dbResult = dbControllerGLS.GetApplicazioni(); rawData = JsonConvert.SerializeObject(dbResult); redisDataList = Encoding.UTF8.GetBytes(rawData); await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); @@ -133,15 +137,30 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + public async Task ApplicazioniUpdate(AnagApplicazioni currItem) + { + bool done = false; + try + { + done = dbControllerGLS.UpdateApplicazioni(currItem); + await InvalidateAllCache(); + } + catch (Exception exc) + { + Log.Error($"Eccezione in ApplicazioniUpdate:{Environment.NewLine}{exc}"); + } + return await Task.FromResult(done); + } + public async Task DbForceMigrate() { - return await Task.FromResult(dbController.DbForceMigrate()); + return await Task.FromResult(dbControllerGLS.DbForceMigrate()); } public void Dispose() { // Clear database controller - dbController.Dispose(); + dbControllerGLS.Dispose(); } public async Task> InstallazioniGetAll() @@ -159,7 +178,7 @@ namespace LiMan.UI.Data { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - dbResult = dbController.GetInstallazioni(); + dbResult = dbControllerGLS.GetInstallazioni(); rawData = JsonConvert.SerializeObject(dbResult); redisDataList = Encoding.UTF8.GetBytes(rawData); await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); @@ -170,6 +189,21 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + public async Task InstallazioniUpdate(AnagInstallazioni currItem) + { + bool done = false; + try + { + done = dbControllerGLS.UpdateInstallazioni(currItem); + await InvalidateAllCache(); + } + catch (Exception exc) + { + Log.Error($"Eccezione in InstallazioniUpdate:{Environment.NewLine}{exc}"); + } + return await Task.FromResult(done); + } + /// /// invalida tutta la cache in caso di update /// @@ -199,7 +233,7 @@ namespace LiMan.UI.Data { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - dbResult = dbController.GetLicenze(); + dbResult = dbControllerGLS.GetLicenze(); rawData = JsonConvert.SerializeObject(dbResult); redisDataList = Encoding.UTF8.GetBytes(rawData); await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); @@ -210,6 +244,37 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + public async Task> LicenzeGetFilt(SelectGLS CurrFilter) + { + List dbResult = new List(); + string cacheKey = mHash($"LicenzeFilt:OA_{CurrFilter.OnlyActive}:APP_{CurrFilter.ApplicazioneSel}:INS_{CurrFilter.InstallazioneSel}"); + string rawData; + var redisDataList = await distributedCache.GetAsync(cacheKey); + if (redisDataList != null) + { + rawData = Encoding.UTF8.GetString(redisDataList); + dbResult = JsonConvert.DeserializeObject>(rawData); + } + else + { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbControllerGLS.GetLicenzeFilt(CurrFilter.OnlyActive, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel); + rawData = JsonConvert.SerializeObject(dbResult); + redisDataList = Encoding.UTF8.GetBytes(rawData); + await distributedCache.SetAsync(cacheKey, redisDataList, cacheOpt(false)); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB + caching per LicenzeGetAll: {ts.TotalMilliseconds} ms"); + } + return await Task.FromResult(dbResult); + } + + public void rollBackEditGLS(object item) + { + dbControllerGLS.rollBackEntity(item); + } + #endregion Public Methods } } \ No newline at end of file diff --git a/LiMan.UI/Data/MessageService.cs b/LiMan.UI/Data/MessageService.cs index 30c7a4e..eabd30b 100644 --- a/LiMan.UI/Data/MessageService.cs +++ b/LiMan.UI/Data/MessageService.cs @@ -10,6 +10,7 @@ namespace LiMan.UI.Data #region Private Fields private SelectData _detailFilter = SelectData.Init(5, 15); + private SelectGLS _detailFilterGLS = SelectGLS.Init(60, -30); private string _pageIcon; private string _pageName; private string _searchVal; @@ -50,6 +51,23 @@ namespace LiMan.UI.Data } } + public SelectGLS DetailGLSFilter + { + get => _detailFilterGLS; + set + { + if (_detailFilterGLS != value) + { + _detailFilterGLS = value; + + if (EA_FilterUpdated != null) + { + EA_FilterUpdated?.Invoke(); + } + } + } + } + public string PageIcon { get => _pageIcon; diff --git a/LiMan.UI/Data/SelectData.cs b/LiMan.UI/Data/SelectData.cs index baf2d6e..9e44656 100644 --- a/LiMan.UI/Data/SelectData.cs +++ b/LiMan.UI/Data/SelectData.cs @@ -20,15 +20,17 @@ namespace LiMan.UI.Data /// Inizializzazione con periodo e arrotondamento /// /// - /// + /// Num giorni PREVIOUS (indietro) per start /// public static SelectData Init(int minRound, int numDayPrev) { - DateTime endRounded = DateTime.Today.AddDays(1); + // se numDayPrev è < 0 --> start oggi e va al futuro + int dayOffset = numDayPrev > 0 ? 1 : -numDayPrev; + DateTime endRounded = DateTime.Today.AddDays(dayOffset); SelectData answ = new SelectData() { DateEnd = endRounded, - DateStart = endRounded.AddDays(-numDayPrev) + DateStart = endRounded.AddDays(-Math.Abs(numDayPrev)) }; return answ; } diff --git a/LiMan.UI/Data/SelectGLS.cs b/LiMan.UI/Data/SelectGLS.cs new file mode 100644 index 0000000..89d1ab1 --- /dev/null +++ b/LiMan.UI/Data/SelectGLS.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Data +{ + public class SelectGLS : SelectData + { + #region Public Properties + + public string ApplicazioneSel { get; set; } = ""; + public string InstallazioneSel { get; set; } = ""; + + public bool OnlyActive { get; set; } = false; + + #endregion Public Properties + + #region Public Methods + + /// + /// Inizializzazione con periodo e arrotondamento + /// + /// + /// + /// + public static new SelectGLS Init(int minRound, int numDayPrev) + { + var selD = SelectData.Init(minRound, numDayPrev); + return new SelectGLS() { DateStart = selD.DateStart, DateEnd = selD.DateEnd }; + } + + public override bool Equals(object obj) + { + if (!(obj is SelectGLS item)) + return false; + + if (OnlyActive != item.OnlyActive) + return false; + if (ApplicazioneSel != item.ApplicazioneSel) + return false; + if (InstallazioneSel != item.InstallazioneSel) + return false; + + return ((SelectData)this).Equals((SelectData)obj); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 2bc28f9..6950544 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -20,6 +20,7 @@ + @@ -35,4 +36,10 @@ + + + + EditApplicazioni.razor.cs + + \ No newline at end of file diff --git a/LiMan.UI/Pages/Index.razor b/LiMan.UI/Pages/Index.razor index e54d914..e6afe9f 100644 --- a/LiMan.UI/Pages/Index.razor +++ b/LiMan.UI/Pages/Index.razor @@ -1,7 +1,5 @@ @page "/" -

Hello, world!

+

Gestore licenze EgalWare

-Welcome to your new app. - - +

Prego selezionare il modulo desiderato tra quelli disponibili

\ No newline at end of file diff --git a/LiMan.UI/Pages/LiManGLS.razor b/LiMan.UI/Pages/LiManGLS.razor new file mode 100644 index 0000000..a3ccb9c --- /dev/null +++ b/LiMan.UI/Pages/LiManGLS.razor @@ -0,0 +1,40 @@ +@page "/LiManGLS" + +@using LiMan.UI.Components + +
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/LiMan.UI/Pages/LiManGLS.razor.cs b/LiMan.UI/Pages/LiManGLS.razor.cs new file mode 100644 index 0000000..2514316 --- /dev/null +++ b/LiMan.UI/Pages/LiManGLS.razor.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace LiMan.UI.Pages +{ + public partial class LiManGLS + { + } +} \ No newline at end of file diff --git a/LiMan.UI/Shared/NavMenu.razor b/LiMan.UI/Shared/NavMenu.razor index 2f95600..2a23511 100644 --- a/LiMan.UI/Shared/NavMenu.razor +++ b/LiMan.UI/Shared/NavMenu.razor @@ -13,20 +13,25 @@ - - + @**@ + @**@ + @**@
diff --git a/LiMan.sln b/LiMan.sln index fb9bfa1..63ab092 100644 --- a/LiMan.sln +++ b/LiMan.sln @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.GLS", "LiMan.GLS\LiMa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.UI", "LiMan.UI\LiMan.UI.csproj", "{34200CA2-489C-435A-A60B-34DE7B7BA04D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.DB", "LiMan.DB\LiMan.DB.csproj", "{C052CE93-FFDE-4B45-B1BC-BD9882797667}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {34200CA2-489C-435A-A60B-34DE7B7BA04D}.Debug|Any CPU.Build.0 = Debug|Any CPU {34200CA2-489C-435A-A60B-34DE7B7BA04D}.Release|Any CPU.ActiveCfg = Release|Any CPU {34200CA2-489C-435A-A60B-34DE7B7BA04D}.Release|Any CPU.Build.0 = Release|Any CPU + {C052CE93-FFDE-4B45-B1BC-BD9882797667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C052CE93-FFDE-4B45-B1BC-BD9882797667}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C052CE93-FFDE-4B45-B1BC-BD9882797667}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C052CE93-FFDE-4B45-B1BC-BD9882797667}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE