Inizio inserimento filtri x licenze

This commit is contained in:
Samuele Locatelli
2021-10-08 17:41:59 +02:00
parent 9f8fc56e22
commit c2c2f866b1
10 changed files with 388 additions and 209 deletions
+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)
+67 -58
View File
@@ -1,61 +1,70 @@
@using LiMan.UI.Components
@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 class="card">
<div class="card-header">
<h3>Applicazioni</h3>
</div>
}
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
<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>
+75 -66
View File
@@ -1,69 +1,78 @@
@using LiMan.UI.Components
@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 class="card">
<div class="card-header">
<h3>Installazioni</h3>
</div>
}
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
<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>
+120 -68
View File
@@ -1,76 +1,128 @@
@using LiMan.UI.Components
@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)
<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)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
foreach (var item in ListInstall)
{
<option value="@item.Installazione">@item.Installazione | @item.Descrizione</option>
}
}
else
</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)
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
foreach (var item in ListApp)
{
<option value="@item.Applicativo">@item.Applicativo | @item.Descrizione</option>
}
}
</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>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
}
<div>
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
<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>
+30 -1
View File
@@ -14,6 +14,9 @@ namespace LiMan.UI.Components
#region Private Fields
private LicenzeAttive currRecord = null;
private List<AnagApplicazioni> ListApp;
private List<AnagInstallazioni> ListInstall;
private List<LicenzeAttive> ListRecords;
private List<LicenzeAttive> SearchRecords;
@@ -53,6 +56,30 @@ namespace LiMan.UI.Components
}
}
private string SelApp
{
get
{
return AppMService.DetailGLSFilter.ApplicazioneSel;
}
set
{
AppMService.DetailGLSFilter.ApplicazioneSel = value;
}
}
private string SelInst
{
get
{
return AppMService.DetailGLSFilter.InstallazioneSel;
}
set
{
AppMService.DetailGLSFilter.InstallazioneSel = value;
}
}
#endregion Private Properties
#region Protected Properties
@@ -78,8 +105,10 @@ namespace LiMan.UI.Components
private async Task ReloadAllData()
{
isLoading = true;
ListRecords = null;
ListApp = await DataService.ApplicazioniGetAll();
ListInstall = await DataService.InstallazioniGetAll();
await Task.Delay(1);
//ListRecords = null;
SearchRecords = await DataService.LicenzeGetAll();
totalCount = SearchRecords.Count();
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+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
}
}
+15 -10
View File
@@ -10,10 +10,7 @@
<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="#TabApp">Applicazioni</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#TabInst">Installazioni</a>
<a class="nav-link" data-toggle="pill" href="#TabAnag">Anagrafiche Applicazioni/Installazioni</a>
</li>
</ul>
</div>
@@ -21,13 +18,21 @@
<!-- Tab panes -->
<div class="tab-content border">
<div class="tab-pane container-fluid active" id="TabLicenze">
<ListLicenze></ListLicenze>
<div class="row">
<div class="col-12 px-0">
<ListLicenze></ListLicenze>
</div>
</div>
</div>
<div class="tab-pane container-fluid" id="TabApp">
<ListApplicazioni></ListApplicazioni>
</div>
<div class="tab-pane container-fluid" id="TabInst">
<ListInstallazioni></ListInstallazioni>
<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>
+1 -1
View File
@@ -14,7 +14,7 @@
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="LiManGLS">
<span class="oi oi-list-rich" aria-hidden="true"></span> Gestore Licenze Legacy
<span class="oi oi-list-rich" aria-hidden="true"></span> Licenze Legacy STW
</NavLink>
</li>
@*<li class="nav-item px-3">