Merge branch 'feature/ReviewFiltering' into develop
This commit is contained in:
@@ -49,12 +49,68 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ODL> CommesseGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.Where(x => x.KeyRichiesta.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.KeyRichiesta)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.Macchine> MacchineGetAll()
|
||||
{
|
||||
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
@@ -77,26 +133,6 @@ namespace MP.Data.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> StatArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella controlli da filtro
|
||||
/// </summary>
|
||||
@@ -107,13 +143,6 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
List<DatabaseModels.ResControlli> dbResult = new List<DatabaseModels.ResControlli>();
|
||||
|
||||
//dbResult = dbCtx
|
||||
// .DbSetControlli
|
||||
// .Where(x => x.Note.Contains(searchVal) || x.IdxMacchina.Contains(searchVal) || x.CodArticolo.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
// .OrderByDescending(x => x.DataOra)
|
||||
// .Take(numRecord)
|
||||
// .ToList();
|
||||
|
||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||
var dataTo = new SqlParameter("@dataTo", DataEnd);
|
||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||
@@ -161,24 +190,6 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella MAcchine
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.Macchine> StatMacchineGetAll()
|
||||
{
|
||||
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella ODL da filtro
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
@using MP.Stats.Data
|
||||
@inject NavigationManager NavManager
|
||||
@inject MessageService MessageService
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
GRAFICO
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<i class="fas fa-angle-double-right fa-4x"></i>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-block btn-primary" @onclick="() => ShowDDB()" title="Vai al Diario Produzione"><span class="oi oi-clipboard"></span> Diario Produzione</button>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-block btn-info" @onclick="() => ShowUAL()" title="Vai all'User ActionLog"><span class="oi oi-document"></span> User ActionLog</button>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-block btn-success" @onclick="() => ShowCont()" title="Vai al Registro Controlli"><span class="oi oi-beaker"></span> Registro Controlli</button>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button class="btn btn-block btn-warning" @onclick="() => ShowScar()" title="Vai al Registro Scarti"><span class="oi oi-warning"></span> Registro Scarti</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code{
|
||||
|
||||
protected MP.Data.DatabaseModels.TurniOee _currRecord = new MP.Data.DatabaseModels.TurniOee();
|
||||
|
||||
[Parameter]
|
||||
public MP.Data.DatabaseModels.TurniOee currRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currRecord;
|
||||
}
|
||||
set
|
||||
{
|
||||
_currRecord = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public SelectData CurrFilter { get; set; }
|
||||
|
||||
protected void ShowCont()
|
||||
{
|
||||
SetFilter();
|
||||
// rimando...
|
||||
NavManager.NavigateTo($"controlli");
|
||||
}
|
||||
|
||||
protected void ShowDDB()
|
||||
{
|
||||
SetFilter();
|
||||
// rimando...
|
||||
NavManager.NavigateTo($"diario");
|
||||
}
|
||||
|
||||
protected void ShowScar()
|
||||
{
|
||||
SetFilter();
|
||||
// rimando...
|
||||
NavManager.NavigateTo($"scarti");
|
||||
}
|
||||
|
||||
protected void ShowUAL()
|
||||
{
|
||||
SetFilter();
|
||||
// rimando...
|
||||
NavManager.NavigateTo($"userlog");
|
||||
}
|
||||
|
||||
protected void SetFilter()
|
||||
{
|
||||
int oraStart = 0;
|
||||
switch (currRecord.Turno)
|
||||
{
|
||||
case "T1":
|
||||
oraStart = 6;
|
||||
break;
|
||||
case "T2":
|
||||
oraStart = 14;
|
||||
break;
|
||||
case "T3":
|
||||
oraStart = 22;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CurrFilter = new SelectData()
|
||||
{
|
||||
IdxMacchina = currRecord.IdxMacchina,
|
||||
CodArticolo = currRecord.CodArticolo,
|
||||
DateStart = currRecord.DataRif.AddHours(oraStart),
|
||||
DateEnd = currRecord.DataRif.AddHours(oraStart + 8)
|
||||
};
|
||||
MessageService.DetailFilter = CurrFilter;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
<EditForm Model="@SelFilter">
|
||||
@using Blazorise.Components
|
||||
@using MP.Stats.Data
|
||||
|
||||
<EditForm Model="@SelFilter">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
@@ -15,20 +18,50 @@
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="idxMacc" class="small">macchina:</label>
|
||||
<input id="idxMacc" class="form-control form-control-sm" @bind="@IdxMacchina" />
|
||||
<InputSelect @bind-Value="@IdxMacchina" id="maccSel" class="form-control form-control-sm" title="idxMacc">
|
||||
@foreach (var item in ddlMacchine)
|
||||
{
|
||||
<option value="@item.ValueField">@item.LabelField</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-group">
|
||||
<label for="keyRich" class="small">commessa:</label>
|
||||
<input id="keyRich" class="form-control form-control-sm" @bind="@KeyRichiesta" />
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text">commessa:</label>
|
||||
</div>
|
||||
<input class="form-control form-control-sm" @bind="@SearchCom" placeholder="search (> @minChar char)" />
|
||||
</div>
|
||||
<InputSelect @bind-Value="@KeyRichiesta" id="KeyRich" class="form-control form-control-sm" title="Macchina">
|
||||
@foreach (var item in ddlCommesse)
|
||||
{
|
||||
<option value="@item.ValueField">@item.LabelField</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="CodArt" class="small">articolo:</label>
|
||||
<input id="CodArt" class="form-control form-control-sm" @bind="@CodArticolo" />
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<label class="input-group-text">articolo:</label>
|
||||
</div>
|
||||
<input class="form-control form-control-sm" @bind="@SearchArt" placeholder="search (> @minChar char)" />
|
||||
</div>
|
||||
<InputSelect @bind-Value="@CodArticolo" class="form-control form-control-sm" title="Macchina">
|
||||
@foreach (var item in ddlArticoli)
|
||||
{
|
||||
<option value="@item.ValueField">@item.LabelField</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 text-right">
|
||||
<div class="form-group">
|
||||
<label for="btnReset" class="small">reset</label><br />
|
||||
<Button id="btnReset" class="btn btn-info btn-sm btn-block" Clicked="resetFilter"><span class="oi oi-loop-circular"></span></Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,23 @@ namespace MP.Stats.Components
|
||||
{
|
||||
public partial class SelectionFilter
|
||||
{
|
||||
#region Protected Fields
|
||||
|
||||
protected string _searchArt = "";
|
||||
protected string _searchCom = "";
|
||||
protected int minChar = 3;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<AutocompleteModel> ddlArticoli { get; set; }
|
||||
private List<AutocompleteModel> ddlCommesse { get; set; }
|
||||
private List<AutocompleteModel> ddlMacchine { get; set; }
|
||||
private string selectedSearchValue { get; set; } = "*";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string CodArticolo
|
||||
@@ -20,10 +37,9 @@ namespace MP.Stats.Components
|
||||
}
|
||||
set
|
||||
{
|
||||
bool doReport = (!SelFilter.CodArticolo.Equals(value));
|
||||
SelFilter.CodArticolo = value;
|
||||
if (doReport)
|
||||
if (!SelFilter.CodArticolo.Equals(value))
|
||||
{
|
||||
SelFilter.CodArticolo = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
@@ -71,10 +87,9 @@ namespace MP.Stats.Components
|
||||
}
|
||||
set
|
||||
{
|
||||
bool doReport = (!SelFilter.IdxMacchina.Equals(value));
|
||||
SelFilter.IdxMacchina = value;
|
||||
if (doReport)
|
||||
if (!SelFilter.IdxMacchina.Equals(value))
|
||||
{
|
||||
SelFilter.IdxMacchina = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
@@ -88,15 +103,49 @@ namespace MP.Stats.Components
|
||||
}
|
||||
set
|
||||
{
|
||||
bool doReport = (!SelFilter.KeyRichiesta.Equals(value));
|
||||
SelFilter.KeyRichiesta = value;
|
||||
if (doReport)
|
||||
if (!SelFilter.KeyRichiesta.Equals(value))
|
||||
{
|
||||
SelFilter.KeyRichiesta = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string SearchArt
|
||||
{
|
||||
get => _searchArt;
|
||||
set
|
||||
{
|
||||
_searchArt = value;
|
||||
int numRowArt = -1;
|
||||
if (value.Count() > minChar)
|
||||
{
|
||||
numRowArt = 20;
|
||||
}
|
||||
ddlArticoli = StatService.ArticoliGetSearch(numRowArt, SearchArt).Result;
|
||||
CodArticolo = "*";
|
||||
}
|
||||
}
|
||||
|
||||
protected string SearchCom
|
||||
{
|
||||
get => _searchCom;
|
||||
set
|
||||
{
|
||||
_searchCom = value;
|
||||
int numRowArt = -1;
|
||||
if (value.Count() > minChar)
|
||||
{
|
||||
numRowArt = 20;
|
||||
}
|
||||
ddlCommesse = StatService.CommesseGetSearch(numRowArt, SearchCom).Result;
|
||||
KeyRichiesta = "*";
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MpStatsService StatService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
@@ -104,6 +153,9 @@ namespace MP.Stats.Components
|
||||
[Parameter]
|
||||
public EventCallback<SelectData> filterChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<SelectData> filterReset { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectData SelFilter { get; set; }
|
||||
|
||||
@@ -111,11 +163,37 @@ namespace MP.Stats.Components
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void MySearchHandler(string newValue)
|
||||
{
|
||||
IdxMacchina = newValue;
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
ddlMacchine = await StatService.MachineList();
|
||||
ddlArticoli = await StatService.ArticoliGetSearch(-1, SearchArt);
|
||||
ddlCommesse = await StatService.CommesseGetSearch(-1, SearchArt);
|
||||
}
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
filterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected void resetFilter()
|
||||
{
|
||||
filterReset.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Stats.Data
|
||||
{
|
||||
public class AutocompleteModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string LabelField { get; set; }
|
||||
public string ValueField { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,17 @@ namespace MP.Stats.Data
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private string searchVal;
|
||||
private SelectData _detailFilter = new SelectData();
|
||||
private SelectData _masterFilter = new SelectData();
|
||||
private string _searchVal;
|
||||
private bool showSearch;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Events
|
||||
|
||||
public event Action EA_FilterUpdated;
|
||||
|
||||
public event Action EA_HideSearch;
|
||||
|
||||
public event Action EA_SearchUpdated;
|
||||
@@ -26,14 +30,37 @@ namespace MP.Stats.Data
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string SearchVal
|
||||
public SelectData DDB_Filter { get; set; } = SelectData.Init(5, 3);
|
||||
|
||||
public SelectData DetailFilter
|
||||
{
|
||||
get => searchVal;
|
||||
get => _detailFilter;
|
||||
set
|
||||
{
|
||||
if (searchVal != value)
|
||||
if (_detailFilter != value)
|
||||
{
|
||||
searchVal = value;
|
||||
_detailFilter = value;
|
||||
|
||||
if (EA_FilterUpdated != null)
|
||||
{
|
||||
EA_FilterUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SelectData KRE_Filter { get; set; } = SelectData.Init(5, 7);
|
||||
public SelectData ODL_Filter { get; set; } = SelectData.Init(5, 7);
|
||||
public SelectData OEE_Filter { get; set; } = SelectData.Init(5, 7);
|
||||
|
||||
public string SearchVal
|
||||
{
|
||||
get => _searchVal;
|
||||
set
|
||||
{
|
||||
if (_searchVal != value)
|
||||
{
|
||||
_searchVal = value;
|
||||
|
||||
if (EA_SearchUpdated != null)
|
||||
{
|
||||
|
||||
@@ -124,16 +124,54 @@ namespace MP.Stats.Data
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public Task<List<AutocompleteModel>> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
if (numRecord > -1)
|
||||
{
|
||||
answ.AddRange(dbController.ArticoliGetSearch(numRecord, searchVal).Select(x => new AutocompleteModel { LabelField = $"{x.CodArticolo} {x.DescArticolo} {x.Disegno}", ValueField = x.CodArticolo }).ToList());
|
||||
}
|
||||
return Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public Task<List<AutocompleteModel>> ArticoliList(string searchVal)
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
answ.AddRange(dbController.MacchineGetAll().Select(x => new AutocompleteModel { LabelField = x.IdxMacchina, ValueField = x.IdxMacchina }).ToList());
|
||||
return Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public Task<List<AutocompleteModel>> CommesseGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
if (numRecord > -1)
|
||||
{
|
||||
answ.AddRange(dbController.CommesseGetSearch(numRecord, searchVal).Select(x => new AutocompleteModel { LabelField = $"{x.CodArticolo} | {x.KeyRichiesta}", ValueField = x.KeyRichiesta }).ToList());
|
||||
}
|
||||
return Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public Task<List<MP.Data.DatabaseModels.Macchine>> MacchineGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.MacchineGetAll().ToList());
|
||||
}
|
||||
|
||||
public Task<List<AutocompleteModel>> MachineList()
|
||||
{
|
||||
List<AutocompleteModel> answ = new List<AutocompleteModel>();
|
||||
answ.Add(new AutocompleteModel { LabelField = "--- TUTTE ---", ValueField = "*" });
|
||||
answ.AddRange(dbController.MacchineGetAll().Select(x => new AutocompleteModel { LabelField = $"{x.IdxMacchina} | {x.Nome} {x.Descrizione} ", ValueField = x.IdxMacchina }).ToList());
|
||||
return Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public void rollBackEdit(object item)
|
||||
{
|
||||
dbController.RollBackEntity(item);
|
||||
}
|
||||
|
||||
public Task<MP.Data.DatabaseModels.AnagArticoli[]> StatArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
return Task.FromResult(dbController.StatArticoliGetSearch(numRecord, searchVal).ToArray());
|
||||
}
|
||||
|
||||
public async Task<List<MP.Data.DatabaseModels.ResControlli>> StatControlliGetAll(SelectData CurrFilter, string searchVal = "")
|
||||
{
|
||||
//return Task.FromResult(dbController.StatControlliGetAll(DataStart, DataEnd, IdxMacchina, IdxODL, KeyRichiesta, CodArticolo).ToArray());
|
||||
@@ -178,11 +216,6 @@ namespace MP.Stats.Data
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public Task<MP.Data.DatabaseModels.Macchine[]> StatMacchineGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.StatMacchineGetAll().ToArray());
|
||||
}
|
||||
|
||||
public async Task<List<MP.Data.DatabaseModels.ODL>> StatOdlGetAll(SelectData CurrFilter, string searchVal = "")
|
||||
{
|
||||
//return Task.FromResult(dbController.StatOdlGetAll(numRecord, searchVal));
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<PackageReference Include="Blazorise" Version="0.9.3.6" />
|
||||
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.6" />
|
||||
<PackageReference Include="Blazorise.Charts" Version="0.9.3.6" />
|
||||
<PackageReference Include="Blazorise.Components" Version="0.9.3.6" />
|
||||
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/controlli"
|
||||
@*@page "/controlli/{IdxMacchina}"*@
|
||||
|
||||
@using MP.Stats.Components
|
||||
|
||||
@@ -13,13 +14,17 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null)
|
||||
@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">
|
||||
|
||||
@@ -21,9 +21,10 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private int currPage { get; set; } = 1;
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -57,6 +58,26 @@ namespace MP.Stats.Pages
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public SelectData currFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.DetailFilter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.DetailFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData()
|
||||
@@ -94,7 +115,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -106,6 +126,15 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
+41
-37
@@ -13,52 +13,56 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null || ListRecords.Count() == 0)
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
<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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Stato</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Stato</th>
|
||||
<th class="text-right">Durata</th>
|
||||
<th class="text-right">Pezzi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.IdxMacchina, record.CodArticolo, record.InizioStato)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.InizioStato.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.InizioStato.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.Descrizione</td>
|
||||
<td class="text-right">@record.DurataMin</td>
|
||||
<td class="text-right">@record.TotPzProd</td>
|
||||
</tr>
|
||||
<tr class="@checkSelect(@record.IdxMacchina, record.CodArticolo, record.InizioStato)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.InizioStato.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.InizioStato.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">@record.Descrizione</td>
|
||||
<td class="text-right">@record.DurataMin</td>
|
||||
<td class="text-right">@record.TotPzProd</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
|
||||
@@ -21,7 +21,19 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private SelectData currFilter
|
||||
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.DDB_Filter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.DDB_Filter = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
@@ -94,7 +106,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 3);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -106,6 +117,15 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 3);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -13,13 +13,21 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null)
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<DetailOee currRecord="@currRecord"></DetailOee>
|
||||
}
|
||||
@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">
|
||||
@@ -27,6 +35,7 @@
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@*<th><button class="btn btn-sm btn-primary" @onclick="() => ResetData()"><span class="oi oi-loop-circular"></span></button></th>*@
|
||||
<th>Data</th>
|
||||
<th>Turno</th>
|
||||
<th>Macchina</th>
|
||||
@@ -40,8 +49,11 @@
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(record.DataRif, record.Turno, @record.IdxMacchina)">
|
||||
|
||||
@*<td><button class="btn btn-sm btn-primary" @onclick="() => Select(record)"><span class="oi oi-magnifying-glass"></span></button></td>*@
|
||||
<td>
|
||||
<div>@record.DataRif.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataRif.ToString("dddd")</div>
|
||||
</td>
|
||||
<td>@record.Turno</td>
|
||||
<td>
|
||||
|
||||
@@ -22,7 +22,18 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private SelectData currFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.OEE_Filter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.OEE_Filter = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
@@ -74,6 +85,7 @@ namespace MP.Stats.Pages
|
||||
|
||||
protected async Task DoFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = newFilter;
|
||||
@@ -95,7 +107,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -107,6 +118,21 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected void Select(MP.Data.DatabaseModels.TurniOee selRecord)
|
||||
{
|
||||
// applico filtro da selezione
|
||||
currRecord = selRecord;
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -13,13 +13,17 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null || ListRecords.Count() == 0)
|
||||
@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">
|
||||
|
||||
@@ -21,7 +21,18 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private SelectData currFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.ODL_Filter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.ODL_Filter = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
@@ -91,7 +102,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -103,6 +113,15 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -13,13 +13,17 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null)
|
||||
@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">
|
||||
|
||||
@@ -21,7 +21,18 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private SelectData currFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.DetailFilter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.DetailFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
@@ -54,6 +65,7 @@ namespace MP.Stats.Pages
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -93,7 +105,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -105,6 +116,15 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -13,13 +13,17 @@
|
||||
<div class="card-body py-0">
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter" filterReset="ResetFilter"></SelectionFilter>
|
||||
</div>
|
||||
</div>
|
||||
@if (totalCount == 0 || ListRecords == null)
|
||||
@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">
|
||||
|
||||
@@ -22,7 +22,18 @@ namespace MP.Stats.Pages
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private SelectData currFilter
|
||||
{
|
||||
get
|
||||
{
|
||||
return MessageService.DetailFilter;
|
||||
}
|
||||
set
|
||||
{
|
||||
MessageService.DetailFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage { get; set; } = 1;
|
||||
private bool isLoading { get; set; } = false;
|
||||
private int numRecord { get; set; } = 10;
|
||||
@@ -96,7 +107,6 @@ namespace MP.Stats.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
MessageService.ShowSearch = false;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
await reloadData();
|
||||
@@ -108,6 +118,15 @@ namespace MP.Stats.Pages
|
||||
currRecord = null;
|
||||
}
|
||||
|
||||
protected async Task ResetFilter(SelectData newFilter)
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
currFilter = SelectData.Init(5, 7);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -97,11 +97,6 @@ namespace MP.Stats
|
||||
services.AddSingleton<IConfiguration>(Configuration);
|
||||
services.AddTransient<Services.BlazorTimer>();
|
||||
|
||||
#if false
|
||||
services.AddDbContext<BloggingContext>(options =>
|
||||
options.UseSqlServer(Configuration.GetConnectionString("BloggingDatabase")));
|
||||
#endif
|
||||
|
||||
//services.AddScoped<BBM_SelectData>();
|
||||
services.AddSingleton<MpStatsService>();
|
||||
services.AddScoped<MessageService>();
|
||||
|
||||
Reference in New Issue
Block a user