This commit is contained in:
Samuele Locatelli
2025-06-30 07:59:32 +02:00
56 changed files with 738 additions and 292 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ namespace MP_TAB3.Components
protected override async Task OnParametersSetAsync()
{
IobInfo = await TabSrv.IobInfo(idxMacch);
IobInfo = await TabSrv.IobInfoAsync(idxMacch);
MachineData = TabSrv.MachIobConf(idxMacch);
}
+72 -55
View File
@@ -16,6 +16,14 @@ namespace MP.AppAuth.Controllers
#endregion Public Fields
#region Private Fields
private static IConfiguration _configuration;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public MPController(IConfiguration configuration)
@@ -92,54 +100,6 @@ namespace MP.AppAuth.Controllers
return dbResult;
}
/// <summary>
/// Elenco Record x AnagMicroStati
/// </summary>
/// <returns></returns>
public List<AnagraficaMicroStati> AnagMicroStati()
{
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagMicroStati
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record x AnagraficaStati
/// </summary>
/// <returns></returns>
public List<AnagraficaStati> AnagStati()
{
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagStati
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record x ListValues
/// </summary>
/// <returns></returns>
public List<ListValues> ListValues()
{
List<ListValues> dbResult = new List<ListValues>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetListValue
.ToList();
}
return dbResult;
}
/// <summary>
/// Delete Record AnagKeyValue
/// </summary>
@@ -210,6 +170,38 @@ namespace MP.AppAuth.Controllers
return fatto;
}
/// <summary>
/// Elenco Record x AnagMicroStati
/// </summary>
/// <returns></returns>
public List<AnagraficaMicroStati> AnagMicroStati()
{
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagMicroStati
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record x AnagraficaStati
/// </summary>
/// <returns></returns>
public List<AnagraficaStati> AnagStati()
{
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetAnagStati
.ToList();
}
return dbResult;
}
/// <summary>
/// Delete Record Config
/// </summary>
@@ -288,6 +280,38 @@ namespace MP.AppAuth.Controllers
}
}
/// <summary>
/// Elenco Record x ListValues
/// </summary>
/// <returns></returns>
public List<ListValues> ListValues()
{
List<ListValues> dbResult = new List<ListValues>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetListValue
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record Macchine
/// </summary>
/// <returns></returns>
public List<MacchineModel> MacchineGetAll()
{
List<MacchineModel> dbResult = new List<MacchineModel>();
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
{
dbResult = localDbCtx
.DbSetMacchine
.ToList();
}
return dbResult;
}
/// <summary>
/// Delete Record Vocabolario
/// </summary>
@@ -356,12 +380,5 @@ namespace MP.AppAuth.Controllers
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
@@ -1,24 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class Macchine
[Table("Macchine")]
public partial class MacchineModel
{
#region Public Properties
public string CodMacchina { get; set; }
public int ColNum { get; set; }
public string Css { get; set; }
public string Descrizione { get; set; }
public string IdxMacchina { get; set; }
public string Locazione { get; set; }
public string CodMacchina { get; set; }
public string Nome { get; set; }
public string Descrizione { get; set; }
public string Locazione { get; set; }
public string Note { get; set; }
public int RowNum { get; set; }
public string Css { get; set; }
public string Url { get; set; }
public int ColNum { get; set; }
public int RowNum { get; set; }
#endregion Public Properties
}
+3 -3
View File
@@ -70,7 +70,7 @@ namespace MP.AppAuth
public virtual DbSet<KeepAlive> DbSetKeepAlive { get; set; }
public virtual DbSet<LinkMenuJqm> DbSetLinkMenuJqm { get; set; }
public virtual DbSet<ListValues> DbSetListValue { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MacchineModel> DbSetMacchine { get; set; }
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
public virtual DbSet<VocabolarioModel> DbSetVocabolario { get; set; }
@@ -410,11 +410,11 @@ namespace MP.AppAuth
entity.Property(e => e.Ordinal).HasColumnName("ordinal");
});
modelBuilder.Entity<Macchine>(entity =>
modelBuilder.Entity<MacchineModel>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
entity.ToTable("Macchine");
//entity.ToTable("Macchine");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
+177 -142
View File
@@ -26,6 +26,54 @@ namespace MP.AppAuth.Services
#endregion Public Fields
#region Private Fields
// gestione key Redis
private const string redisBaseAddr = "MP:LAND";
private const string rKeyDirittiUser = $"{redisBaseAddr}:DIR_USER";
private const string rKeyMacchine = $"{redisBaseAddr}:MACCHINE";
private const string rKeyPermUser = $"{redisBaseAddr}:PERM_USER";
private static IConfiguration _configuration;
private static ILogger<AppAuthService> _logger;
private static JsonSerializerSettings? JSSettings;
private static Logger Log = LogManager.GetCurrentClassLogger();
private static string Modulo = "";
/// <summary>
/// Durata cache lunga IN SECONDI
/// </summary>
private int cacheTtlLong = 60 * 5;
/// <summary>
/// Durata cache breve IN SECONDI
/// </summary>
private int cacheTtlShort = 60 * 1;
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
private IConnectionMultiplexer redisConn;
//ISubscriber sub = redis.GetSubscriber();
/// <summary>
/// Oggetto DB redis da impiegare x chiamate R/W
/// </summary>
private StackExchange.Redis.IDatabase redisDb = null!;
private Random rnd = new Random();
private Dictionary<string, string> Vocabolario = new Dictionary<string, string>();
#endregion Private Fields
#region Public Constructors
public AppAuthService(IConfiguration configuration, ILogger<AppAuthService> logger, IConnectionMultiplexer redisConnMult)
@@ -64,6 +112,36 @@ namespace MP.AppAuth.Services
#endregion Public Constructors
#region Private Properties
private string CodApp { get; set; } = "";
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan FastCache
{
get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000);
}
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan LongCache
{
get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000);
}
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan UltraLongCache
{
get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000);
}
#endregion Private Properties
#region Public Methods
/// <summary>
@@ -114,54 +192,6 @@ namespace MP.AppAuth.Services
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista AnagEventi
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaIngressi>> AnagIngressi()
{
List<AnagraficaIngressi> dbResult = new List<AnagraficaIngressi>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagIngressi();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagIngressi: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista AnagEventi
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaMicroStati>> AnagMicroStati()
{
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagMicroStati();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagMicroStati: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista AnagStati
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaStati>> AnagStati()
{
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagStati();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagStati: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista Gruppi
/// </summary>
@@ -178,22 +208,6 @@ namespace MP.AppAuth.Services
return await Task.FromResult(dbResult);
}
/// <summary>
/// Elenco ListValues
/// </summary>
/// <returns></returns>
public async Task<List<ListValues>> ListValues()
{
List<ListValues> dbResult = new List<ListValues>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.ListValues();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per ListValues: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<AnagraficaGruppi>> AnagGruppiFilt(string codTipo)
{
List<AnagraficaGruppi> dbResult = new List<AnagraficaGruppi>();
@@ -206,6 +220,22 @@ namespace MP.AppAuth.Services
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista AnagEventi
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaIngressi>> AnagIngressi()
{
List<AnagraficaIngressi> dbResult = new List<AnagraficaIngressi>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagIngressi();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagIngressi: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<bool> AnagKeyValAdd(AnagKeyValueModel currRec)
{
bool answ = false;
@@ -254,6 +284,22 @@ namespace MP.AppAuth.Services
return await Task.FromResult(answ);
}
/// <summary>
/// Lista AnagEventi
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaMicroStati>> AnagMicroStati()
{
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagMicroStati();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagMicroStati: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<List<AnagraficaOperatori>> AnagOperByGroupList(string codGruppo, string searchVal)
{
List<AnagraficaOperatori> dbResult = new List<AnagraficaOperatori>();
@@ -283,6 +329,22 @@ namespace MP.AppAuth.Services
return await Task.FromResult(dbResult);
}
/// <summary>
/// Lista AnagStati
/// </summary>
/// <returns></returns>
public async Task<List<AnagraficaStati>> AnagStati()
{
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.AnagStati();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagStati: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public async Task<bool> ConfigAdd(ConfigModel currRec)
{
bool answ = false;
@@ -382,6 +444,57 @@ namespace MP.AppAuth.Services
CheckVoc();
}
/// <summary>
/// Elenco ListValues
/// </summary>
/// <returns></returns>
public async Task<List<ListValues>> ListValues()
{
List<ListValues> dbResult = new List<ListValues>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = MpDbController.ListValues();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per ListValues: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Elenco Macchine gestite
/// </summary>
/// <param name="UserName"></param>
/// <returns></returns>
public List<MacchineModel> MacchineGetAll()
{
string source = "DB";
List<MacchineModel>? dbResult = new List<MacchineModel>();
string currKey = $"{rKeyMacchine}";
Stopwatch sw = new Stopwatch();
sw.Start();
string? rawData = redisDb.StringGet(currKey);
if (!string.IsNullOrEmpty(rawData) && rawData.Length > 2)
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<List<MacchineModel>>(rawData);
dbResult = tempResult ?? new List<MacchineModel>();
}
else
{
// recupero diritti utente
dbResult = MpDbController.MacchineGetAll();
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
redisDb.StringSet(currKey, rawData, UltraLongCache);
}
if (dbResult == null)
{
dbResult = new List<MacchineModel>();
}
sw.Stop();
Log.Debug($"MacchineGetAll | {source} | {sw.ElapsedMilliseconds} ms");
return dbResult;
}
/// <summary>
/// Elenco permessi dato utente
/// </summary>
@@ -539,84 +652,6 @@ namespace MP.AppAuth.Services
#endregion Protected Methods
#region Private Fields
// gestione key Redis
private const string redisBaseAddr = "MP:LAND";
private const string rKeyDirittiUser = $"{redisBaseAddr}:DIR_USER";
private const string rKeyPermUser = $"{redisBaseAddr}:PERM_USER";
private static IConfiguration _configuration;
private static ILogger<AppAuthService> _logger;
private static List<Macchine> ElencoMacchine = new List<Macchine>();
private static JsonSerializerSettings? JSSettings;
private static Logger Log = LogManager.GetCurrentClassLogger();
private static string Modulo = "";
/// <summary>
/// Durata cache lunga IN SECONDI
/// </summary>
private int cacheTtlLong = 60 * 5;
/// <summary>
/// Durata cache breve IN SECONDI
/// </summary>
private int cacheTtlShort = 60 * 1;
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
private IConnectionMultiplexer redisConn;
//ISubscriber sub = redis.GetSubscriber();
/// <summary>
/// Oggetto DB redis da impiegare x chiamate R/W
/// </summary>
private StackExchange.Redis.IDatabase redisDb = null!;
private Random rnd = new Random();
private Dictionary<string, string> Vocabolario = new Dictionary<string, string>();
#endregion Private Fields
#region Private Properties
private string CodApp { get; set; } = "";
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan FastCache
{
get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000);
}
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan LongCache
{
get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000);
}
/// <summary>
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
/// </summary>
private TimeSpan UltraLongCache
{
get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000);
}
#endregion Private Properties
#region Private Methods
/// <summary>
+2 -2
View File
@@ -216,9 +216,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="codGruppo"></param>
/// <returns></returns>
public List<Macchine> MacchineGetFilt(string codGruppo)
public List<MacchineModel> MacchineGetFilt(string codGruppo)
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(_configuration))
+4 -4
View File
@@ -71,9 +71,9 @@ namespace MP.Data.Controllers
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DbModels.Macchine> MacchineGetAll()
public List<DbModels.MacchineModel> MacchineGetAll()
{
List<DbModels.Macchine> dbResult = new List<DbModels.Macchine>();
List<DbModels.MacchineModel> dbResult = new List<DbModels.MacchineModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
@@ -90,9 +90,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="codGruppo"></param>
/// <returns></returns>
public List<Macchine> MacchineGetFilt(string codGruppo)
public List<MacchineModel> MacchineGetFilt(string codGruppo)
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(_configuration))
+5 -5
View File
@@ -1425,9 +1425,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="MatrOpr"></param>
/// <returns></returns>
public List<Macchine> MacchineByMatrOper(int MatrOpr)
public List<MacchineModel> MacchineByMatrOper(int MatrOpr)
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(_configuration))
@@ -1475,9 +1475,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="codGruppo"></param>
/// <returns></returns>
public List<Macchine> MacchineGetFilt(string codGruppo)
public List<MacchineModel> MacchineGetFilt(string codGruppo)
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(_configuration))
@@ -1514,7 +1514,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
/// Elenco id MacchineModel che abbiano dati FLuxLog, nel periodo indicato
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
+2 -2
View File
@@ -126,9 +126,9 @@ namespace MP.Data.Controllers
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<Macchine> MacchineGetAll()
public List<MacchineModel> MacchineGetAll()
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
+2 -2
View File
@@ -936,9 +936,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="MatrOpr"></param>
/// <returns></returns>
public List<Macchine> MacchineByMatrOper(int MatrOpr)
public List<MacchineModel> MacchineByMatrOper(int MatrOpr)
{
List<Macchine> dbResult = new List<Macchine>();
List<MacchineModel> dbResult = new List<MacchineModel>();
try
{
using (var dbCtx = new MoonProContext(_configuration))
+1 -1
View File
@@ -35,7 +35,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
+1 -1
View File
@@ -38,7 +38,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto ODL
+1 -1
View File
@@ -35,7 +35,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
+1 -1
View File
@@ -21,7 +21,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Machine
+1 -1
View File
@@ -58,7 +58,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
+2 -2
View File
@@ -10,8 +10,8 @@ using System.ComponentModel.DataAnnotations.Schema;
// </Auto-Generated>
namespace MP.Data.DbModels
{
[Table("Macchine")]
public partial class Macchine
[Table("MacchineModel")]
public partial class MacchineModel
{
#region Public Properties
+1 -1
View File
@@ -54,7 +54,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
+1 -1
View File
@@ -57,7 +57,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
+1 -1
View File
@@ -74,7 +74,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
+1 -1
View File
@@ -61,7 +61,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
+1 -1
View File
@@ -25,7 +25,7 @@ namespace MP.Data.DbModels
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
public virtual MacchineModel MachineNav { get; set; } = null!;
#endregion Public Properties
}
+2 -2
View File
@@ -50,7 +50,7 @@ namespace MP.Data
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
public virtual DbSet<LinkMenuModel> DbSetLinkMenu { get; set; }
public virtual DbSet<ListValuesModel> DbSetListValues { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MacchineModel> DbSetMacchine { get; set; }
public virtual DbSet<MappaStatoExplModel> DbSetMSE { get; set; }
public virtual DbSet<ODLModel> DbSetODL { get; set; }
public virtual DbSet<ODLExpModel> DbSetODLExp { get; set; }
@@ -190,7 +190,7 @@ namespace MP.Data
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
modelBuilder.Entity<MacchineModel>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
+2 -2
View File
@@ -49,7 +49,7 @@ namespace MP.Data
public virtual DbSet<AnagArticoliModel> DbSetArticoli { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MacchineModel> DbSetMacchine { get; set; }
public virtual DbSet<FluxLogModel> DbSetFluxLog { get; set; }
public virtual DbSet<DossierModel> DbSetDossiers { get; set; }
public virtual DbSet<ParetoFluxLogDTO> DbSetParetoFluxLog { get; set; }
@@ -111,7 +111,7 @@ namespace MP.Data
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
modelBuilder.Entity<MacchineModel>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
+2 -2
View File
@@ -43,7 +43,7 @@ namespace MP.Data
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
public virtual DbSet<FLModel> DbSetFL { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MacchineModel> DbSetMacchine { get; set; }
public virtual DbSet<StatsODL> DbSetODL { get; set; }
public virtual DbSet<OdlEnergyModel> DbSetOdlEnergy { get; set; }
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
@@ -159,7 +159,7 @@ namespace MP.Data
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
modelBuilder.Entity<MacchineModel>(entity =>
{
entity.HasNoKey();
+4 -4
View File
@@ -234,19 +234,19 @@ namespace MP.Data.Services
/// </summary>
/// <param name="MatrOpr"></param>
/// <returns></returns>
public async Task<List<Macchine>> MacchineByMatrOper(int MatrOpr)
public async Task<List<MacchineModel>> MacchineByMatrOper(int MatrOpr)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<Macchine>? result = new List<Macchine>();
List<MacchineModel>? result = new List<MacchineModel>();
// cerco in redis...
string currKey = $"{redisBaseKey}:Macc:{MatrOpr}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
//if (!string.IsNullOrEmpty($"{rawData}"))
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<MacchineModel>>($"{rawData}");
source = "REDIS";
}
else
@@ -258,7 +258,7 @@ namespace MP.Data.Services
}
if (result == null)
{
result = new List<Macchine>();
result = new List<MacchineModel>();
}
sw.Stop();
Log.Debug($"MacchineGetFilt | MatrOpr: {MatrOpr} | {source} | {sw.Elapsed.TotalMilliseconds}ms");
+4 -4
View File
@@ -125,14 +125,14 @@ namespace MP.Data.Services
/// <summary>
/// Cache elenco macchine abilitate all'utente, vuoto se scaduto reload
/// </summary>
public List<Macchine>? ListMachineEnabled
public List<MacchineModel>? ListMachineEnabled
{
get
{
List<Macchine>? answ = userListMachine;
List<MacchineModel>? answ = userListMachine;
if (DateTime.Now.Subtract(lastUserUpd).TotalSeconds > 30)
{
answ = new List<Macchine>();
answ = new List<MacchineModel>();
Log.Debug("ListMachineEnabled unvalidated");
}
return answ;
@@ -710,7 +710,7 @@ namespace MP.Data.Services
#region Private Properties
private List<Macchine>? userListMachine { get; set; } = null;
private List<MacchineModel>? userListMachine { get; set; } = null;
private Dictionary<string, string> UserPrefs { get; set; } = new Dictionary<string, string>();
#endregion Private Properties
+8 -8
View File
@@ -167,18 +167,18 @@ namespace MP.Data.Services
return outVal;
}
public async Task<List<Macchine>> MacchineGetAll()
public async Task<List<MacchineModel>> MacchineGetAll()
{
Stopwatch sw = new Stopwatch();
string source = "DB";
sw.Start();
List<Macchine>? result = new List<Macchine>();
List<MacchineModel>? result = new List<MacchineModel>();
// cerco in redis...
string currKey = $"{Constants.redisMacchine}:ALL";
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<MacchineModel>>($"{rawData}");
source = "REDIS";
}
else
@@ -190,7 +190,7 @@ namespace MP.Data.Services
}
if (result == null)
{
result = new List<Macchine>();
result = new List<MacchineModel>();
}
sw.Stop();
Log.Debug($"MacchineGetAll | {source} | {sw.Elapsed.TotalMilliseconds}ms");
@@ -198,18 +198,18 @@ namespace MP.Data.Services
//return Task.FromResult(dbController.MacchineGetAll());
}
public async Task<List<Macchine>> MacchineGetByGruppo(string CodGruppo)
public async Task<List<MacchineModel>> MacchineGetByGruppo(string CodGruppo)
{
Stopwatch sw = new Stopwatch();
string source = "DB";
sw.Start();
List<Macchine>? result = new List<Macchine>();
List<MacchineModel>? result = new List<MacchineModel>();
// cerco in redis...
string currKey = $"{Constants.redisMacchine}:{CodGruppo}";
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<MacchineModel>>($"{rawData}");
source = "REDIS";
}
else
@@ -222,7 +222,7 @@ namespace MP.Data.Services
}
if (result == null)
{
result = new List<Macchine>();
result = new List<MacchineModel>();
}
sw.Stop();
Log.Debug($"MacchineGetByGruppo | {source} | {sw.Elapsed.TotalMilliseconds}ms");
+43 -7
View File
@@ -1246,7 +1246,43 @@ namespace MP.Data.Services
/// </summary>
/// <param name="IdxMacchina"></param>
/// <returns></returns>
public async Task<IOB_data> IobInfo(string IdxMacchina)
public IOB_data IobInfo(string IdxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
IOB_data? result = new IOB_data();
// cerco in redis...
string currKey = redHashMpIO($"hM2IOB:{IdxMacchina}");
RedisValue rawData = redisDb.StringGet(currKey);
//if (!string.IsNullOrEmpty($"{rawData}"))
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<IOB_data>($"{rawData}");
source = "REDIS";
}
else
{
Log.Error($"Errore: non trovato valore <IOB_data> valido in REDIS | key: {currKey}");
Log.Info($"REDIS | conf: {redisConn.Configuration}");
Log.Info($" --> Valore trovato:{Environment.NewLine}{rawData}");
}
if (result == null)
{
result = new IOB_data();
Log.Debug($"Init valore default <IOB_data> | IdxMacchina: {IdxMacchina}");
}
sw.Stop();
Log.Debug($"IobInfo per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Recupero info IOB x TAB (da info registrate IOB-WIN--&gt; MP-IO)
/// </summary>
/// <param name="IdxMacchina"></param>
/// <returns></returns>
public async Task<IOB_data> IobInfoAsync(string IdxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
@@ -1273,7 +1309,7 @@ namespace MP.Data.Services
Log.Debug($"Init valore default <IOB_data> | IdxMacchina: {IdxMacchina}");
}
sw.Stop();
Log.Debug($"IobInfo per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms");
Log.Debug($"IobInfoAsync per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
@@ -1431,11 +1467,11 @@ namespace MP.Data.Services
}
/// <summary>
/// Elenco Macchine dato operatore secondo gruppi (macchine/operatore)
/// Elenco MacchineModel dato operatore secondo gruppi (macchine/operatore)
/// </summary>
/// <param name="MatrOpr"></param>
/// <returns></returns>
public async Task<List<Macchine>> MacchineByMatrOper(int MatrOpr)
public async Task<List<MacchineModel>> MacchineByMatrOper(int MatrOpr)
{
int rndWait = rnd.Next(0, 2);
await Task.Delay(rndWait);
@@ -1443,14 +1479,14 @@ namespace MP.Data.Services
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<Macchine> result = new List<Macchine>();
List<MacchineModel> result = new List<MacchineModel>();
// cerco in redis...
string currKey = $"{redisBaseKey}:MachByMatOp:{MatrOpr}";
RedisValue rawData = redisDb.StringGet(currKey);
//if (!string.IsNullOrEmpty($"{rawData}"))
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<MacchineModel>>($"{rawData}");
source = "REDIS";
}
else
@@ -1462,7 +1498,7 @@ namespace MP.Data.Services
}
if (result == null)
{
result = new List<Macchine>();
result = new List<MacchineModel>();
}
sw.Stop();
+1 -1
View File
@@ -16,7 +16,7 @@ namespace MP.Land.Components
#endregion Public Properties
[Inject]
protected MessageService MServ { get; set; } = null!;
protected LMessageService MServ { get; set; } = null!;
#region Public Classes
+1 -1
View File
@@ -23,7 +23,7 @@ namespace MP.Land.Components
{
[Inject]
protected MessageService AppMService { get; set; }
protected LMessageService AppMService { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
+1 -1
View File
@@ -31,7 +31,7 @@ namespace MP.Land.Components
#region Protected Properties
[Inject]
protected MessageService AppMessages { get; set; } = null!;
protected LMessageService AppMessages { get; set; } = null!;
#endregion Protected Properties
@@ -48,7 +48,7 @@ namespace MP.Land.Components
[Inject]
protected AppAuthService DataService { get; set; }
[Inject]
protected MessageService AppMServ { get; set; } = null!;
protected LMessageService AppMServ { get; set; } = null!;
public string searchVal
{
+1 -1
View File
@@ -286,7 +286,7 @@ namespace MP.Land.Components
[Inject]
protected MessageService AppMServ { get; set; } = null!;
protected LMessageService AppMServ { get; set; } = null!;
public string searchVal
{
@@ -49,7 +49,7 @@ namespace MP.Land.Components
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MessageService AppMServ { get; set; } = null!;
protected LMessageService AppMServ { get; set; } = null!;
public string searchVal
{
+1 -1
View File
@@ -5,7 +5,7 @@
@inject IConfiguration Configuration
@inject AppAuthService DataService
@inject MessageService MService
@inject LMessageService MService
@inject LicenseService LicServ
@if (authOk())
+1 -1
View File
@@ -2,7 +2,7 @@
@using MP.Land.Data
@using Majorsoft.Blazor.Components.Debounce
@inject MessageService MessageService
@inject LMessageService MessageService
<div class="input-group input-group-sm">
<DebounceInput id="sVal" class="form-control" placeholder="@("Ricerca libera")" autocomplete="off" @ref="debInput" @bind-Value="@_searchVal" @bind-Value:event="OnInput" DebounceTime="@_debMsec" MinLength="@_minChar" OnValueChanged="e => { searchVal = e; }" ForceNotifyByEnter="true" ForceNotifyOnBlur="true" />
@@ -6,11 +6,11 @@ using System.Threading.Tasks;
namespace MP.Land.Data
{
public class MessageService
public class LMessageService
{
#region Public Constructors
public MessageService(ILocalStorageService genLocalStorage, ISessionStorageService sessStore)
public LMessageService(ILocalStorageService genLocalStorage, ISessionStorageService sessStore)
{
// gestione sessioni in browser
localStore = genLocalStorage;
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.16.2505.2814</Version>
<Version>6.16.2506.2809</Version>
<Configurations>Debug;Release;Debug_LiManDebug</Configurations>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
+1 -1
View File
@@ -10,7 +10,7 @@
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="badge rounded-pill bg-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare &nbsp;<img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
+1 -1
View File
@@ -13,7 +13,7 @@ namespace MP.Land.Pages
[Inject]
protected MessageService AppMService { get; set; } = null!;
protected LMessageService AppMService { get; set; } = null!;
[Inject]
protected LicenseService LicServ{get;set;}=null!;
#region Protected Methods
+1 -1
View File
@@ -52,7 +52,7 @@ namespace MP.Land.Pages
}
[Inject]
protected MessageService AppMService { get; set; }
protected LMessageService AppMService { get; set; }
[Inject]
protected IConfiguration Configuration { get; set; }
+2 -2
View File
@@ -1,7 +1,7 @@
@page "/Contacts"
@using MP.Land.Data
@inject MessageService AppMService
@inject LMessageService AppMService
<div class="row mx-2">
<div class="col-12 col-xl-10 offset-xl-1">
@@ -13,7 +13,7 @@
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="badge rounded-pill bg-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare &nbsp;<img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
+1 -1
View File
@@ -29,7 +29,7 @@ namespace MP.Land.Pages
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
protected LMessageService AppMService { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
+139
View File
@@ -0,0 +1,139 @@
@page "/IobList"
<div class="row">
<div class="col-12">
<div class="card shadow">
<div class="card-header text-center">
<div class="row">
<div class="col-4">
<div class="input-group">
<span class="input-group-text" id="inputGroup-sizing-default">Ricerca</span>
<input type="text" class="form-control" placeholder="alt-/" @bind="SearchValue" accesskey="/">
<button class="btn @BtnResetCss" @onclick="ResetSearch"><i class="fa-solid fa-rotate-right"></i></button>
</div>
</div>
<div class="col-4">
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge rounded-pill bg-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
@if (isLoading || 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">
<thead>
<tr>
<th>Macchina</th>
<th>Idx</th>
<th>Cod</th>
<th>Descr</th>
<th>Loc.</th>
<th>R</th>
<th>C</th>
<th>Note</th>
<th>IOB Type</th>
<th>IOB IP</th>
<th>IOB Name</th>
<th>Count</th>
<th>Tipo</th>
<th>Vers</th>
<th>Detail</th>
</tr>
</thead>
<tbody>
@foreach (var item in ListRecords)
{
var cIobInfo = CurrIobInfo(item.IdxMacchina);
<tr class="@checkSelect(item)">
<td>@item.Nome</td>
<td>@item.IdxMacchina</td>
<td>@item.CodMacchina</td>
<td>@item.Descrizione</td>
<td>
@if (string.IsNullOrEmpty(item.Locazione))
{
<span>-</span>
}
else
{
@item.Locazione
}
</td>
<td>@item.RowNum</td>
<td>@item.ColNum</td>
<td>@item.Note</td>
<td>@cIobInfo.iType</td>
<td>@cIobInfo.IP</td>
<td>@cIobInfo.name</td>
<td>
@{
string icnCol = cIobInfo.CNC_Counter ? "fa-solid fa-thumbs-up text-success" : "fa-solid fa-thumbs-down text-secondary";
}
<i class="@icnCol"></i>
</td>
<td>@MacIobConf(item.IdxMacchina, "IobType")</td>
<td>@MacIobConf(item.IdxMacchina, "IobVersion")</td>
<td>AccordData
@* <div class="accordion" id="AccordGrp">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Show All Opt.Params
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse" aria-labelledby="headingOne" data-bs-parent="#AccordGrp">
<div class="accordion-body">
<ul class="list-group list-group-sm">
@foreach (var item in MachineData)
{
<li class="list-group-item list-group-item-dark">
<div class="d-flex justify-content-between">
<div class="px-0">@item.Key</div>
<div class="px-0 fw-bold">@item.Value</div>
</div>
</li>
}
</ul>
</div>
</div>
</div>
</div> *@
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="14">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="totalCount" showLoading="isLoading" />
</td>
</tr>
</tfoot>
</table>
</div>
</div>
}
</div>
@* <div class="card-footer py-1">
</div> *@
</div>
</div>
</div>
+204
View File
@@ -0,0 +1,204 @@
using DnsClient.Protocol;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop;
using MP.AppAuth.Models;
using MP.AppAuth.Services;
using MP.Data.Services;
using MP.Land.Data;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Pages
{
public partial class IobList : ComponentBase, IDisposable
{
#region Private Fields
/// <summary>
/// Classe logger
/// </summary>
private static Logger Log = LogManager.GetCurrentClassLogger();
private List<MacchineModel> ListRecords = new List<MacchineModel>();
private List<MacchineModel> SearchRecords = new List<MacchineModel>();
private List<MacchineModel> AllRecords = new List<MacchineModel>();
private string Titolo = "";
private int totalCount = 0;
#endregion Private Fields
#region Protected Properties
[Inject]
protected AppAuthService AppDService { get; set; }
[Inject]
protected LMessageService AppMService { get; set; }
[Inject]
protected IConfiguration Configuration { get; set; }
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
#endregion Protected Properties
#region Public Methods
public void Dispose()
{
ListRecords = null;
GC.Collect();
}
#endregion Public Methods
#region Protected Methods
protected override void OnInitialized()
{
ListRecords = null;
Titolo = "Elenco IOB Amministrati";
AppMService.ShowSearch = false;
AppMService.PageName = "IobList";
AppMService.PageIcon = "fas fa-computer pe-2";
DataInit();
}
private string searchVal = "";
protected string SearchValue
{
get => searchVal;
set
{
searchVal = value;
RefreshDisplay();
}
}
protected void ResetSearch()
{
SearchValue = "";
}
protected string BtnResetCss
{
get => string.IsNullOrEmpty(SearchValue) ? "btn-outline-secondary" : "btn-outline-primary";
}
[Inject]
protected TabDataService TabSrv { get; set; } = null!;
protected void DataInit()
{
isLoading = true;
// importante altrimenti NON mostra update UI
AllRecords = AppDService.MacchineGetAll();
// leggo i remoteRebootLog e cerco IdxMacc NON presenti, aggiungendo...
// fare!!! FixMe ToDo: aggiungere modello RRL, e query specifica x recuperare record con idxMacchina non presenti in tab Macchine..
// accodo a List di AllRecords
// leggo le info IOB x ogni record trovato...
DictIobInfo = AllRecords.ToDictionary(x => x.IdxMacchina, x => TabSrv.IobInfo(x.IdxMacchina));
DictMachData = AllRecords.ToDictionary(x => x.IdxMacchina, x => TabSrv.MachIobConf(x.IdxMacchina));
RefreshDisplay();
isLoading = false;
}
protected Dictionary<string, Core.Objects.IOB_data> DictIobInfo = new Dictionary<string, Core.Objects.IOB_data>();
protected Dictionary<string, Dictionary<string, string>> DictMachData = new Dictionary<string, Dictionary<string, string>>();
protected Core.Objects.IOB_data CurrIobInfo(string idxMacc)
{
Core.Objects.IOB_data answ = new Core.Objects.IOB_data();
if (DictIobInfo.ContainsKey(idxMacc))
{
answ = DictIobInfo[idxMacc];
}
return answ;
}
public string MacIobConf(string idxMacc, string kReq)
{
string answ = "-";
if (DictMachData.ContainsKey(idxMacc))
{
var cRec = DictMachData[idxMacc];
if (cRec.ContainsKey(kReq))
{
answ = cRec[kReq];
}
}
return answ;
}
private bool isLoading = false;
private int currPage = 1;
private int numRecord = 10;
protected void SetNumRec(int newNum)
{
numRecord = newNum;
RefreshDisplay();
}
protected void SetPage(int newNum)
{
currPage = newNum;
RefreshDisplay();
}
private void RefreshDisplay()
{
// se ho ricerca filtro...
if (string.IsNullOrEmpty(searchVal))
{
SearchRecords = AllRecords;
}
else
{
SearchRecords = AllRecords
.Where(x => x.Nome.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase)
|| x.CodMacchina.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase)
|| x.Descrizione.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase)
|| x.IdxMacchina.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase))
.ToList();
}
// conto record
totalCount = SearchRecords.Count();
// fix paginazione
ListRecords = SearchRecords
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
}
protected string checkSelect(MacchineModel IdxODL)
{
string answ = "";
#if false
if (currRecord != null)
{
try
{
answ = (currRecord.IdxOdl == IdxODL) ? "table-info" : "";
}
catch
{ }
}
#endif
return answ;
}
#endregion Protected Methods
}
}
+2 -2
View File
@@ -5,7 +5,7 @@
@using Microsoft.Extensions.Configuration
@inject AppAuthService DataService
@inject MessageService AppMService
@inject LMessageService AppMService
@inject IConfiguration Configuration
<div class="row mx-2">
@@ -18,7 +18,7 @@
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="badge rounded-pill bg-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
+1 -1
View File
@@ -7,7 +7,7 @@ namespace MP.Land.Pages
#region Protected Properties
[Inject]
protected Data.MessageService MServ { get; set; } = null!;
protected Data.LMessageService MServ { get; set; } = null!;
#endregion Protected Properties
+1 -1
View File
@@ -70,7 +70,7 @@ namespace MP.Land.Pages
protected AppAuthService AppDService { get; set; }
[Inject]
protected MessageService AppMService { get; set; }
protected LMessageService AppMService { get; set; }
[Inject]
protected IConfiguration Configuration { get; set; }
+1 -1
View File
@@ -34,7 +34,7 @@ namespace MP.Land.Pages
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
protected LMessageService AppMService { get; set; }
protected string BaseUrlTab
{
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo Tablet MAPO - DotNet6</i>
<h4>Versione: 6.16.2505.2814</h4>
<h4>Versione: 6.16.2506.2809</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2505.2814
6.16.2506.2809
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2505.2814</version>
<version>6.16.2506.2809</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -3,7 +3,7 @@
@using MP.Land.Data
@using MP.Land.Components
@inject MessageService AppMService
@inject LMessageService AppMService
@inject LicenseService LicServ
@implements IDisposable
+9
View File
@@ -40,6 +40,15 @@
}
</NavLink>
</div>
<div class="nav-item px-2">
<NavLink class="nav-link py-0 px-2 mb-0" href="IobList">
<span class="fas fa-computer fs-4 pe-2" aria-hidden="true"></span>
@if (showText)
{
<span class="@hideText">IOB List</span>
}
</NavLink>
</div>
<div class="nav-item px-2">
<NavLink class="nav-link py-0 px-2 mb-0" href="UpdateManager">
<span class="fas fa-download fs-4 pe-2" aria-hidden="true"></span>
+2 -1
View File
@@ -142,9 +142,10 @@ namespace MP.Land
services.AddSingleton<SyncService>();
services.AddSingleton<RestCallService>();
services.AddSingleton<TaskService>();
services.AddSingleton<TabDataService>();
services.AddScoped<AppAuthService>();
services.AddScoped<Data.MessageService>();
services.AddScoped<LMessageService>();
services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
services.AddBlazoredLocalStorage();
+4 -1
View File
@@ -60,7 +60,9 @@
"MP.All": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"MP.Land.Auth": "Server=SQL2016DEV;Database=MoonPro_Anagrafica;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "redis.ufficio:26379, serviceName=devel, defaultDatabase=1, keepAlive=180, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, allowAdmin=true"
"MP.Tab": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.Land;",
//"Redis": "redis.ufficio:26379, serviceName=devel, defaultDatabase=1, keepAlive=180, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false, allowAdmin=true",
"Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=5, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true"
},
"Application": {
"SafePages": "||LAND|Home|Index|About|Help|Unauthorized|"
@@ -70,6 +72,7 @@
"downloadPath": "C:\\Steamware\\installers\\MP",
"IobUploadPath": "C:\\inetpub\\wwwroot\\MP\\fileUpload",
"Modulo": "MoonPro",
"MpIoNS": "MoonPro:SQL2016DEV:MoonPro",
"Prog.ApiUrl": "https://office.egalware.com/MP/PROG"
},
"SpecialConf": {