Merge branch 'feature/LegacySection' into develop

This commit is contained in:
Samuele Locatelli
2021-10-08 18:03:00 +02:00
34 changed files with 1567 additions and 72 deletions
+2 -2
View File
@@ -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
{
+1 -1
View File
@@ -3,7 +3,7 @@ using System.Collections.Generic;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
public partial class AnagApplicazioni
{
+1 -1
View File
@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -1
View File
@@ -6,7 +6,7 @@ using NLog;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
public partial class LicManContext : DbContext
{
+1 -1
View File
@@ -3,7 +3,7 @@ using System.Collections.Generic;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
public partial class LicenzeAttive
{
+1 -1
View File
@@ -3,7 +3,7 @@ using System.Collections.Generic;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
public partial class Permessi
{
+1 -1
View File
@@ -3,7 +3,7 @@ using System.Collections.Generic;
#nullable disable
namespace LiMan.GLS.DatabaseModels
namespace LiMan.DB.DatabaseModels
{
public partial class Permessi2Funzione
{
+15 -15
View File
@@ -1,13 +1,13 @@
// <auto-generated />
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<string>("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<string>("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<int>("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<string>("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<string>("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");
});
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace LiMan.GLS.Migrations
namespace LiMan.DB.Migrations
{
public partial class InitDb : Migration
{
@@ -1,12 +1,12 @@
// <auto-generated />
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<string>("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<string>("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<int>("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<string>("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<string>("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");
});
+99
View File
@@ -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<LicenzeAttive> GetLicenzeFilt(bool OnlyActive, string Appl, string Inst)
{
List<LicenzeAttive> dbResult = new List<LicenzeAttive>();
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;
}
/// <summary>
/// Annulla modifiche su una specifica entity (cancel update)
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
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
}
}
+1 -1
View File
@@ -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);
+1
View File
@@ -9,6 +9,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiMan.DB\LiMan.DB.csproj" />
<ProjectReference Include="..\LiMan.GLS\LiMan.GLS.csproj" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -1,5 +1,5 @@
<div class="row">
<div class="col-12 col-lg-9 text-left">
<div class="col-12 col-lg-8 text-left">
<div class="row">
<div class="col-12 small">
@if (totalCount > 0)
@@ -29,7 +29,7 @@
</div>
</div>
</div>
<div class="col-12 col-lg-3">
<div class="col-12 col-lg-4">
<div class="d-flex">
<div class="p-1 flex-fill text-right">
@if (!showLoading)
@@ -0,0 +1,40 @@
@using LiMan.UI.Components
@using Microsoft.AspNetCore.Components.Authorization
@using LiMan.UI.Data
@using Microsoft.Extensions.Configuration
<div class="card">
<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>
<div class="card-body small p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-10">
<div class="row">
<div class="col-12 col-lg-3">
<h3>@_currItem.Applicativo</h3>
</div>
<div class="col-12 col-lg-9">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
Descrizione
</span>
</div>
<InputTextArea @bind-Value="@_currItem.Descrizione" class="form-control"></InputTextArea>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-2">
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
<div class="mt-2">
<button type="button" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
</div>
</div>
</EditForm>
</div>
</div>
@@ -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<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> 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
/// <summary>
/// Blazor: get query parm from the URL
/// </summary>
/// <param name="parmName"></param>
/// <returns></returns>
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
}
}
@@ -0,0 +1,60 @@
@using LiMan.UI.Components
@using Microsoft.AspNetCore.Components.Authorization
@using LiMan.UI.Data
@using Microsoft.Extensions.Configuration
<div class="card">
<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>
<div class="card-body small p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-10">
<div class="row">
<div class="col-12 col-lg-3">
<b>@_currItem.Installazione</b>
</div>
<div class="col-12 col-lg-9">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
Descrizione
</span>
</div>
<InputText @bind-Value="@_currItem.Descrizione" class="form-control"></InputText>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
Contatto
</span>
</div>
<InputText @bind-Value="@_currItem.Contatto" class="form-control"></InputText>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
Email
</span>
</div>
<InputText @bind-Value="@_currItem.Email" class="form-control"></InputText>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-2">
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
<div class="mt-2">
<button type="button" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
</div>
</div>
</EditForm>
</div>
</div>
@@ -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<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> 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
/// <summary>
/// Blazor: get query parm from the URL
/// </summary>
/// <param name="parmName"></param>
/// <returns></returns>
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
}
}
@@ -0,0 +1,70 @@
@using LiMan.UI.Components
<div class="card">
<div class="card-header">
<h3>Applicazioni</h3>
</div>
<div class="card-body">
@if (currRecord != null)
{
<EditApplicazioni currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData"></EditApplicazioni>
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th></th>
<th>Applicazione</th>
<th class="text-right">Descrizione</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.Applicativo)">
<td class="text-nowrap">
@if (currRecord == null)
{
if (!record.Applicativo.StartsWith("_"))
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
}
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<b>@record.Applicativo</b>
</td>
<td class="text-right">
<div>@record.Descrizione</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
@@ -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<AnagApplicazioni> ListRecords;
private List<AnagApplicazioni> 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
}
}
@@ -0,0 +1,78 @@
@using LiMan.UI.Components
<div class="card">
<div class="card-header">
<h3>Installazioni</h3>
</div>
<div class="card-body">
@if (currRecord != null)
{
<EditInstallazioni currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData"></EditInstallazioni>
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th></th>
<th>Installazione</th>
<th class="text-right">Descrizione</th>
<th class="text-right">Contatto</th>
<th class="text-right">Email</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.Installazione)">
<td class="text-nowrap">
@if (currRecord == null)
{
if (!record.Installazione.StartsWith("_"))
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
}
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<b>@record.Installazione</b>
</td>
<td class="text-right">
<div>@record.Descrizione</div>
</td>
<td class="text-right">
<div>@record.Contatto</div>
</td>
<td class="text-right">
<div>@record.Email</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
@@ -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<AnagInstallazioni> ListRecords;
private List<AnagInstallazioni> 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
}
}
+138
View File
@@ -0,0 +1,138 @@
@using LiMan.UI.Components
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-3">
<h3>Licenze</h3>
</div>
<div class="col-9">
<div class="d-flex flex-row-reverse justify-content-between">
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
Installazione
</span>
</div>
<select @bind="@SelInst" class="form-control form-control-sm">
<option value="">--- Tutti ---</option>
@if (ListInstall != null)
{
foreach (var item in ListInstall)
{
<option value="@item.Installazione">@item.Installazione | @item.Descrizione</option>
}
}
</select>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
Applicazione
</span>
</div>
<select @bind="@SelApp" class="form-control form-control-sm">
<option value="">--- Tutti ---</option>
@if (ListApp != null)
{
foreach (var item in ListApp)
{
<option value="@item.Applicativo">@item.Applicativo | @item.Descrizione</option>
}
}
</select>
</div>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="togAttivi" title="Solo Attivi / Mostra tutti" @bind-value="@OnlyActive" checked="@OnlyActive" />
<label class="custom-control-label small" for="togAttivi"><sub>solo attivi</sub></label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
@if (currRecord != null)
{
@*<FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList"></FileEditor>*@
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th></th>
<th>Installazione</th>
<th>Applicativo</th>
<th>Scadenza</th>
<th class="text-right">Num Licenze</th>
<th class="text-right">Codice Licenza</th>
<th class="text-right">Descrizione</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<b>@record.Installazione</b>
</td>
<td>
<b>@record.Applicativo</b>
</td>
<td>
<span class="@cssScadenza(record.Scadenza)">@($"{record.Scadenza:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
<div>@record.NumLicenze</div>
</td>
<td class="text-right">
<div>@record.Licenza</div>
</td>
<td class="text-right">
<div>@record.Descrizione</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+248
View File
@@ -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<AnagApplicazioni> ListApp;
private List<AnagInstallazioni> ListInstall;
private List<LicenzeAttive> ListRecords;
private List<LicenzeAttive> 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
/// <summary>
/// formatta testo secondo scadenza:
/// scadenza > 60gg --> verde
/// 0 < scadenza < 60 gg --> giallo
/// scadenza < 0 --> rosso
/// </summary>
/// <param name="scadenza"></param>
/// <returns></returns>
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
}
}
+76 -11
View File
@@ -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<bool> 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<bool> 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<List<AnagInstallazioni>> 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<bool> 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);
}
/// <summary>
/// invalida tutta la cache in caso di update
/// </summary>
@@ -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<List<LicenzeAttive>> LicenzeGetFilt(SelectGLS CurrFilter)
{
List<LicenzeAttive> dbResult = new List<LicenzeAttive>();
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<List<LicenzeAttive>>(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
}
}
+18
View File
@@ -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;
+5 -3
View File
@@ -20,15 +20,17 @@ namespace LiMan.UI.Data
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <param name="numDayPrev"></param>
/// <param name="numDayPrev">Num giorni PREVIOUS (indietro) per start</param>
/// <returns></returns>
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;
}
+55
View File
@@ -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
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <param name="numDayPrev"></param>
/// <returns></returns>
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
}
}
+7
View File
@@ -20,6 +20,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiMan.DB\LiMan.DB.csproj" />
<ProjectReference Include="..\LiMan.GLS\LiMan.GLS.csproj" />
</ItemGroup>
@@ -35,4 +36,10 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Components\EditApplicazioni - Copy.razor.cs">
<DependentUpon>EditApplicazioni.razor.cs</DependentUpon>
</Compile>
</ItemGroup>
</Project>
+2 -4
View File
@@ -1,7 +1,5 @@
@page "/"
<h1>Hello, world!</h1>
<h1>Gestore licenze EgalWare</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />
<p>Prego selezionare il modulo desiderato tra quelli disponibili</p>
+40
View File
@@ -0,0 +1,40 @@
@page "/LiManGLS"
@using LiMan.UI.Components
<div class="px-2">
<div class="row">
<div class="col-12">
<ul class="nav nav-tabs nav-justified">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#TabLicenze">Licenze</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#TabAnag">Anagrafiche Applicazioni/Installazioni</a>
</li>
</ul>
</div>
<div class="col-12">
<!-- Tab panes -->
<div class="tab-content border">
<div class="tab-pane container-fluid active" id="TabLicenze">
<div class="row">
<div class="col-12 px-0">
<ListLicenze></ListLicenze>
</div>
</div>
</div>
<div class="tab-pane container-fluid" id="TabAnag">
<div class="row small">
<div class="col-5 px-0">
<ListApplicazioni></ListApplicazioni>
</div>
<div class="col-7 px-0">
<ListInstallazioni></ListInstallazioni>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+11
View File
@@ -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
{
}
}
+17 -12
View File
@@ -13,20 +13,25 @@
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Applicazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Applicazioni
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Installazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Installazioni
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="LicenseManager">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Licenze
<NavLink class="nav-link" href="LiManGLS">
<span class="oi oi-list-rich" aria-hidden="true"></span> Licenze Legacy STW
</NavLink>
</li>
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="Applicazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Applicazioni
</NavLink>
</li>*@
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="Installazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Installazioni
</NavLink>
</li>*@
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="LicenseManager">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Licenze
</NavLink>
</li>*@
</ul>
</div>
+6
View File
@@ -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