diff --git a/MP-TAB3/Components/IobInfoMan.razor.cs b/MP-TAB3/Components/IobInfoMan.razor.cs index 54594d71..2971a645 100644 --- a/MP-TAB3/Components/IobInfoMan.razor.cs +++ b/MP-TAB3/Components/IobInfoMan.razor.cs @@ -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); } diff --git a/MP.AppAuth/Controllers/MPController .cs b/MP.AppAuth/Controllers/MPController .cs index 62d245ec..b3dee069 100644 --- a/MP.AppAuth/Controllers/MPController .cs +++ b/MP.AppAuth/Controllers/MPController .cs @@ -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; } - /// - /// Elenco Record x AnagMicroStati - /// - /// - public List AnagMicroStati() - { - List dbResult = new List(); - using (MoonProContext localDbCtx = new MoonProContext(_configuration)) - { - dbResult = localDbCtx - .DbSetAnagMicroStati - .ToList(); - } - return dbResult; - } - - /// - /// Elenco Record x AnagraficaStati - /// - /// - public List AnagStati() - { - List dbResult = new List(); - using (MoonProContext localDbCtx = new MoonProContext(_configuration)) - { - dbResult = localDbCtx - .DbSetAnagStati - .ToList(); - } - return dbResult; - } - - /// - /// Elenco Record x ListValues - /// - /// - public List ListValues() - { - List dbResult = new List(); - using (MoonProContext localDbCtx = new MoonProContext(_configuration)) - { - dbResult = localDbCtx - .DbSetListValue - .ToList(); - } - return dbResult; - } - /// /// Delete Record AnagKeyValue /// @@ -210,6 +170,38 @@ namespace MP.AppAuth.Controllers return fatto; } + /// + /// Elenco Record x AnagMicroStati + /// + /// + public List AnagMicroStati() + { + List dbResult = new List(); + using (MoonProContext localDbCtx = new MoonProContext(_configuration)) + { + dbResult = localDbCtx + .DbSetAnagMicroStati + .ToList(); + } + return dbResult; + } + + /// + /// Elenco Record x AnagraficaStati + /// + /// + public List AnagStati() + { + List dbResult = new List(); + using (MoonProContext localDbCtx = new MoonProContext(_configuration)) + { + dbResult = localDbCtx + .DbSetAnagStati + .ToList(); + } + return dbResult; + } + /// /// Delete Record Config /// @@ -288,6 +280,38 @@ namespace MP.AppAuth.Controllers } } + /// + /// Elenco Record x ListValues + /// + /// + public List ListValues() + { + List dbResult = new List(); + using (MoonProContext localDbCtx = new MoonProContext(_configuration)) + { + dbResult = localDbCtx + .DbSetListValue + .ToList(); + } + return dbResult; + } + + /// + /// Elenco Record Macchine + /// + /// + public List MacchineGetAll() + { + List dbResult = new List(); + using (MoonProContext localDbCtx = new MoonProContext(_configuration)) + { + dbResult = localDbCtx + .DbSetMacchine + .ToList(); + } + return dbResult; + } + /// /// Delete Record Vocabolario /// @@ -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 } } \ No newline at end of file diff --git a/MP.AppAuth/Models/Macchine.cs b/MP.AppAuth/Models/MacchineModel.cs similarity index 84% rename from MP.AppAuth/Models/Macchine.cs rename to MP.AppAuth/Models/MacchineModel.cs index f7ef7966..57727c75 100644 --- a/MP.AppAuth/Models/Macchine.cs +++ b/MP.AppAuth/Models/MacchineModel.cs @@ -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 } diff --git a/MP.AppAuth/MoonProContext.cs b/MP.AppAuth/MoonProContext.cs index f1e58261..6a1d615d 100644 --- a/MP.AppAuth/MoonProContext.cs +++ b/MP.AppAuth/MoonProContext.cs @@ -70,7 +70,7 @@ namespace MP.AppAuth public virtual DbSet DbSetKeepAlive { get; set; } public virtual DbSet DbSetLinkMenuJqm { get; set; } public virtual DbSet DbSetListValue { get; set; } - public virtual DbSet DbSetMacchine { get; set; } + public virtual DbSet DbSetMacchine { get; set; } public virtual DbSet DbSetUpdMan { get; set; } public virtual DbSet DbSetVocabolario { get; set; } @@ -410,11 +410,11 @@ namespace MP.AppAuth entity.Property(e => e.Ordinal).HasColumnName("ordinal"); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); - entity.ToTable("Macchine"); + //entity.ToTable("Macchine"); entity.Property(e => e.IdxMacchina).HasMaxLength(50); diff --git a/MP.AppAuth/Services/AppAuthService.cs b/MP.AppAuth/Services/AppAuthService.cs index 75767389..312b12d4 100644 --- a/MP.AppAuth/Services/AppAuthService.cs +++ b/MP.AppAuth/Services/AppAuthService.cs @@ -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 _logger; + + private static JsonSerializerSettings? JSSettings; + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + private static string Modulo = ""; + + /// + /// Durata cache lunga IN SECONDI + /// + private int cacheTtlLong = 60 * 5; + + /// + /// Durata cache breve IN SECONDI + /// + private int cacheTtlShort = 60 * 1; + + /// + /// Oggetto per connessione a REDIS + /// + private IConnectionMultiplexer redisConn; + + //ISubscriber sub = redis.GetSubscriber(); + /// + /// Oggetto DB redis da impiegare x chiamate R/W + /// + private StackExchange.Redis.IDatabase redisDb = null!; + + private Random rnd = new Random(); + + private Dictionary Vocabolario = new Dictionary(); + + #endregion Private Fields + #region Public Constructors public AppAuthService(IConfiguration configuration, ILogger logger, IConnectionMultiplexer redisConnMult) @@ -64,6 +112,36 @@ namespace MP.AppAuth.Services #endregion Public Constructors + #region Private Properties + + private string CodApp { get; set; } = ""; + + /// + /// Durata cache lunga (+ perturbazione percentuale +/-10%) + /// + private TimeSpan FastCache + { + get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000); + } + + /// + /// Durata cache lunga (+ perturbazione percentuale +/-10%) + /// + private TimeSpan LongCache + { + get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000); + } + + /// + /// Durata cache lunga (+ perturbazione percentuale +/-10%) + /// + private TimeSpan UltraLongCache + { + get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000); + } + + #endregion Private Properties + #region Public Methods /// @@ -114,54 +192,6 @@ namespace MP.AppAuth.Services return await Task.FromResult(dbResult); } - /// - /// Lista AnagEventi - /// - /// - public async Task> AnagIngressi() - { - List dbResult = new List(); - 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); - } - - /// - /// Lista AnagEventi - /// - /// - public async Task> AnagMicroStati() - { - List dbResult = new List(); - 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); - } - - /// - /// Lista AnagStati - /// - /// - public async Task> AnagStati() - { - List dbResult = new List(); - 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); - } - /// /// Lista Gruppi /// @@ -178,22 +208,6 @@ namespace MP.AppAuth.Services return await Task.FromResult(dbResult); } - /// - /// Elenco ListValues - /// - /// - public async Task> ListValues() - { - List dbResult = new List(); - 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> AnagGruppiFilt(string codTipo) { List dbResult = new List(); @@ -206,6 +220,22 @@ namespace MP.AppAuth.Services return await Task.FromResult(dbResult); } + /// + /// Lista AnagEventi + /// + /// + public async Task> AnagIngressi() + { + List dbResult = new List(); + 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 AnagKeyValAdd(AnagKeyValueModel currRec) { bool answ = false; @@ -254,6 +284,22 @@ namespace MP.AppAuth.Services return await Task.FromResult(answ); } + /// + /// Lista AnagEventi + /// + /// + public async Task> AnagMicroStati() + { + List dbResult = new List(); + 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> AnagOperByGroupList(string codGruppo, string searchVal) { List dbResult = new List(); @@ -283,6 +329,22 @@ namespace MP.AppAuth.Services return await Task.FromResult(dbResult); } + /// + /// Lista AnagStati + /// + /// + public async Task> AnagStati() + { + List dbResult = new List(); + 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 ConfigAdd(ConfigModel currRec) { bool answ = false; @@ -382,6 +444,57 @@ namespace MP.AppAuth.Services CheckVoc(); } + /// + /// Elenco ListValues + /// + /// + public async Task> ListValues() + { + List dbResult = new List(); + 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); + } + + /// + /// Elenco Macchine gestite + /// + /// + /// + public List MacchineGetAll() + { + string source = "DB"; + List? dbResult = new List(); + 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>(rawData); + dbResult = tempResult ?? new List(); + } + else + { + // recupero diritti utente + dbResult = MpDbController.MacchineGetAll(); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + redisDb.StringSet(currKey, rawData, UltraLongCache); + } + if (dbResult == null) + { + dbResult = new List(); + } + sw.Stop(); + Log.Debug($"MacchineGetAll | {source} | {sw.ElapsedMilliseconds} ms"); + return dbResult; + } + /// /// Elenco permessi dato utente /// @@ -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 _logger; - - private static List ElencoMacchine = new List(); - - private static JsonSerializerSettings? JSSettings; - - private static Logger Log = LogManager.GetCurrentClassLogger(); - - private static string Modulo = ""; - - /// - /// Durata cache lunga IN SECONDI - /// - private int cacheTtlLong = 60 * 5; - - /// - /// Durata cache breve IN SECONDI - /// - private int cacheTtlShort = 60 * 1; - - /// - /// Oggetto per connessione a REDIS - /// - private IConnectionMultiplexer redisConn; - - //ISubscriber sub = redis.GetSubscriber(); - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - private StackExchange.Redis.IDatabase redisDb = null!; - - private Random rnd = new Random(); - - private Dictionary Vocabolario = new Dictionary(); - - #endregion Private Fields - - #region Private Properties - - private string CodApp { get; set; } = ""; - - /// - /// Durata cache lunga (+ perturbazione percentuale +/-10%) - /// - private TimeSpan FastCache - { - get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000); - } - - /// - /// Durata cache lunga (+ perturbazione percentuale +/-10%) - /// - private TimeSpan LongCache - { - get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000); - } - - /// - /// Durata cache lunga (+ perturbazione percentuale +/-10%) - /// - private TimeSpan UltraLongCache - { - get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000); - } - - #endregion Private Properties - #region Private Methods /// diff --git a/MP.Data/Controllers/MpIocController.cs b/MP.Data/Controllers/MpIocController.cs index fb314801..17a9d49e 100644 --- a/MP.Data/Controllers/MpIocController.cs +++ b/MP.Data/Controllers/MpIocController.cs @@ -216,9 +216,9 @@ namespace MP.Data.Controllers /// /// /// - public List MacchineGetFilt(string codGruppo) + public List MacchineGetFilt(string codGruppo) { - List dbResult = new List(); + List dbResult = new List(); try { using (var dbCtx = new MoonProContext(_configuration)) diff --git a/MP.Data/Controllers/MpMonController.cs b/MP.Data/Controllers/MpMonController.cs index 5dc6758a..4003acf1 100644 --- a/MP.Data/Controllers/MpMonController.cs +++ b/MP.Data/Controllers/MpMonController.cs @@ -71,9 +71,9 @@ namespace MP.Data.Controllers /// Elenco da tabella Macchine /// /// - public List MacchineGetAll() + public List MacchineGetAll() { - List dbResult = new List(); + List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { dbResult = dbCtx @@ -90,9 +90,9 @@ namespace MP.Data.Controllers /// /// /// - public List MacchineGetFilt(string codGruppo) + public List MacchineGetFilt(string codGruppo) { - List dbResult = new List(); + List dbResult = new List(); try { using (var dbCtx = new MoonProContext(_configuration)) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 6fe0e37d..1a8bbe54 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -1425,9 +1425,9 @@ namespace MP.Data.Controllers /// /// /// - public List MacchineByMatrOper(int MatrOpr) + public List MacchineByMatrOper(int MatrOpr) { - List dbResult = new List(); + List dbResult = new List(); try { using (var dbCtx = new MoonProContext(_configuration)) @@ -1475,9 +1475,9 @@ namespace MP.Data.Controllers /// /// /// - public List MacchineGetFilt(string codGruppo) + public List MacchineGetFilt(string codGruppo) { - List dbResult = new List(); + List dbResult = new List(); try { using (var dbCtx = new MoonProContext(_configuration)) @@ -1514,7 +1514,7 @@ namespace MP.Data.Controllers } /// - /// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato + /// Elenco id MacchineModel che abbiano dati FLuxLog, nel periodo indicato /// /// /// diff --git a/MP.Data/Controllers/MpStatsController.cs b/MP.Data/Controllers/MpStatsController.cs index 079878ef..acf6ffda 100644 --- a/MP.Data/Controllers/MpStatsController.cs +++ b/MP.Data/Controllers/MpStatsController.cs @@ -126,9 +126,9 @@ namespace MP.Data.Controllers /// Elenco da tabella Macchine /// /// - public List MacchineGetAll() + public List MacchineGetAll() { - List dbResult = new List(); + List dbResult = new List(); using (var dbCtx = new MoonPro_STATSContext(_configuration)) { dbResult = dbCtx diff --git a/MP.Data/Controllers/MpTabController.cs b/MP.Data/Controllers/MpTabController.cs index 3104a874..028a0fcf 100644 --- a/MP.Data/Controllers/MpTabController.cs +++ b/MP.Data/Controllers/MpTabController.cs @@ -936,9 +936,9 @@ namespace MP.Data.Controllers /// /// /// - public List MacchineByMatrOper(int MatrOpr) + public List MacchineByMatrOper(int MatrOpr) { - List dbResult = new List(); + List dbResult = new List(); try { using (var dbCtx = new MoonProContext(_configuration)) diff --git a/MP.Data/DbModels/DiarioDiBordoModel.cs b/MP.Data/DbModels/DiarioDiBordoModel.cs index afea0f94..5053711e 100644 --- a/MP.Data/DbModels/DiarioDiBordoModel.cs +++ b/MP.Data/DbModels/DiarioDiBordoModel.cs @@ -35,7 +35,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// diff --git a/MP.Data/DbModels/DossierModel.cs b/MP.Data/DbModels/DossierModel.cs index d4e7623a..0cb3bb31 100644 --- a/MP.Data/DbModels/DossierModel.cs +++ b/MP.Data/DbModels/DossierModel.cs @@ -38,7 +38,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto ODL diff --git a/MP.Data/DbModels/EventListModel.cs b/MP.Data/DbModels/EventListModel.cs index 27e6805e..c4ba5bd7 100644 --- a/MP.Data/DbModels/EventListModel.cs +++ b/MP.Data/DbModels/EventListModel.cs @@ -35,7 +35,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo diff --git a/MP.Data/DbModels/Gruppi2MaccModel.cs b/MP.Data/DbModels/Gruppi2MaccModel.cs index 01daae65..eff27663 100644 --- a/MP.Data/DbModels/Gruppi2MaccModel.cs +++ b/MP.Data/DbModels/Gruppi2MaccModel.cs @@ -21,7 +21,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Machine diff --git a/MP.Data/DbModels/InsManualiModel.cs b/MP.Data/DbModels/InsManualiModel.cs index f3e96fb2..a692763d 100644 --- a/MP.Data/DbModels/InsManualiModel.cs +++ b/MP.Data/DbModels/InsManualiModel.cs @@ -58,7 +58,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo diff --git a/MP.Data/DbModels/MacchineModel.cs b/MP.Data/DbModels/MacchineModel.cs index b3899d7a..1cf87207 100644 --- a/MP.Data/DbModels/MacchineModel.cs +++ b/MP.Data/DbModels/MacchineModel.cs @@ -10,8 +10,8 @@ using System.ComponentModel.DataAnnotations.Schema; // namespace MP.Data.DbModels { - [Table("Macchine")] - public partial class Macchine + [Table("MacchineModel")] + public partial class MacchineModel { #region Public Properties diff --git a/MP.Data/DbModels/ODLExpModel.cs b/MP.Data/DbModels/ODLExpModel.cs index 3d74eead..dfdee3fd 100644 --- a/MP.Data/DbModels/ODLExpModel.cs +++ b/MP.Data/DbModels/ODLExpModel.cs @@ -54,7 +54,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// diff --git a/MP.Data/DbModels/ODLModel.cs b/MP.Data/DbModels/ODLModel.cs index a5634583..79ae4dbb 100644 --- a/MP.Data/DbModels/ODLModel.cs +++ b/MP.Data/DbModels/ODLModel.cs @@ -57,7 +57,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// diff --git a/MP.Data/DbModels/PODLExpModel.cs b/MP.Data/DbModels/PODLExpModel.cs index 9577ba01..5352f1c0 100644 --- a/MP.Data/DbModels/PODLExpModel.cs +++ b/MP.Data/DbModels/PODLExpModel.cs @@ -74,7 +74,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// diff --git a/MP.Data/DbModels/PODLModel.cs b/MP.Data/DbModels/PODLModel.cs index 83170e2e..5d660c90 100644 --- a/MP.Data/DbModels/PODLModel.cs +++ b/MP.Data/DbModels/PODLModel.cs @@ -61,7 +61,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; /// /// Navigazione oggetto Articolo /// diff --git a/MP.Data/DbModels/TurniMaccModel.cs b/MP.Data/DbModels/TurniMaccModel.cs index cc413f84..11a35a3d 100644 --- a/MP.Data/DbModels/TurniMaccModel.cs +++ b/MP.Data/DbModels/TurniMaccModel.cs @@ -25,7 +25,7 @@ namespace MP.Data.DbModels /// Navigazione oggetto Machine /// [ForeignKey("IdxMacchina")] - public virtual Macchine MachineNav { get; set; } = null!; + public virtual MacchineModel MachineNav { get; set; } = null!; #endregion Public Properties } diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index a7e01fcf..c833c134 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -50,7 +50,7 @@ namespace MP.Data public virtual DbSet DbSetConfig { get; set; } public virtual DbSet DbSetLinkMenu { get; set; } public virtual DbSet DbSetListValues { get; set; } - public virtual DbSet DbSetMacchine { get; set; } + public virtual DbSet DbSetMacchine { get; set; } public virtual DbSet DbSetMSE { get; set; } public virtual DbSet DbSetODL { get; set; } public virtual DbSet DbSetODLExp { get; set; } @@ -190,7 +190,7 @@ namespace MP.Data .HasMaxLength(50); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); diff --git a/MP.Data/MoonPro_FluxContext.cs b/MP.Data/MoonPro_FluxContext.cs index 3d36a75e..9c14f8bf 100644 --- a/MP.Data/MoonPro_FluxContext.cs +++ b/MP.Data/MoonPro_FluxContext.cs @@ -49,7 +49,7 @@ namespace MP.Data public virtual DbSet DbSetArticoli { get; set; } - public virtual DbSet DbSetMacchine { get; set; } + public virtual DbSet DbSetMacchine { get; set; } public virtual DbSet DbSetFluxLog { get; set; } public virtual DbSet DbSetDossiers { get; set; } public virtual DbSet DbSetParetoFluxLog { get; set; } @@ -111,7 +111,7 @@ namespace MP.Data .HasMaxLength(50); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasKey(e => e.IdxMacchina); diff --git a/MP.Data/MoonPro_STATSContext.cs b/MP.Data/MoonPro_STATSContext.cs index 453fe4e2..0b4b9990 100644 --- a/MP.Data/MoonPro_STATSContext.cs +++ b/MP.Data/MoonPro_STATSContext.cs @@ -43,7 +43,7 @@ namespace MP.Data public virtual DbSet DbSetControlli { get; set; } public virtual DbSet DbSetDdbTurni { get; set; } public virtual DbSet DbSetFL { get; set; } - public virtual DbSet DbSetMacchine { get; set; } + public virtual DbSet DbSetMacchine { get; set; } public virtual DbSet DbSetODL { get; set; } public virtual DbSet DbSetOdlEnergy { get; set; } public virtual DbSet DbSetScarti { get; set; } @@ -159,7 +159,7 @@ namespace MP.Data .HasMaxLength(50); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasNoKey(); diff --git a/MP.Data/Services/ListSelectDataSrv.cs b/MP.Data/Services/ListSelectDataSrv.cs index 6c8c41d6..0e1f4640 100644 --- a/MP.Data/Services/ListSelectDataSrv.cs +++ b/MP.Data/Services/ListSelectDataSrv.cs @@ -234,19 +234,19 @@ namespace MP.Data.Services /// /// /// - public async Task> MacchineByMatrOper(int MatrOpr) + public async Task> MacchineByMatrOper(int MatrOpr) { string source = "DB"; Stopwatch sw = new Stopwatch(); sw.Start(); - List? result = new List(); + List? result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:Macc:{MatrOpr}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else @@ -258,7 +258,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } sw.Stop(); Log.Debug($"MacchineGetFilt | MatrOpr: {MatrOpr} | {source} | {sw.Elapsed.TotalMilliseconds}ms"); diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs index 7d1a7aae..37c2e730 100644 --- a/MP.Data/Services/MessageService.cs +++ b/MP.Data/Services/MessageService.cs @@ -125,14 +125,14 @@ namespace MP.Data.Services /// /// Cache elenco macchine abilitate all'utente, vuoto se scaduto reload /// - public List? ListMachineEnabled + public List? ListMachineEnabled { get { - List? answ = userListMachine; + List? answ = userListMachine; if (DateTime.Now.Subtract(lastUserUpd).TotalSeconds > 30) { - answ = new List(); + answ = new List(); Log.Debug("ListMachineEnabled unvalidated"); } return answ; @@ -710,7 +710,7 @@ namespace MP.Data.Services #region Private Properties - private List? userListMachine { get; set; } = null; + private List? userListMachine { get; set; } = null; private Dictionary UserPrefs { get; set; } = new Dictionary(); #endregion Private Properties diff --git a/MP.Data/Services/StatusData.cs b/MP.Data/Services/StatusData.cs index 9d2e5142..afdece54 100644 --- a/MP.Data/Services/StatusData.cs +++ b/MP.Data/Services/StatusData.cs @@ -167,18 +167,18 @@ namespace MP.Data.Services return outVal; } - public async Task> MacchineGetAll() + public async Task> MacchineGetAll() { Stopwatch sw = new Stopwatch(); string source = "DB"; sw.Start(); - List? result = new List(); + List? result = new List(); // cerco in redis... string currKey = $"{Constants.redisMacchine}:ALL"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else @@ -190,7 +190,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } 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> MacchineGetByGruppo(string CodGruppo) + public async Task> MacchineGetByGruppo(string CodGruppo) { Stopwatch sw = new Stopwatch(); string source = "DB"; sw.Start(); - List? result = new List(); + List? result = new List(); // cerco in redis... string currKey = $"{Constants.redisMacchine}:{CodGruppo}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else @@ -222,7 +222,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } sw.Stop(); Log.Debug($"MacchineGetByGruppo | {source} | {sw.Elapsed.TotalMilliseconds}ms"); diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index c5681c67..f278fdde 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -1246,7 +1246,43 @@ namespace MP.Data.Services /// /// /// - public async Task 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($"{rawData}"); + source = "REDIS"; + } + else + { + Log.Error($"Errore: non trovato valore 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 | IdxMacchina: {IdxMacchina}"); + } + sw.Stop(); + Log.Debug($"IobInfo per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + return result; + } + + /// + /// Recupero info IOB x TAB (da info registrate IOB-WIN--> MP-IO) + /// + /// + /// + public async Task IobInfoAsync(string IdxMacchina) { string source = "DB"; Stopwatch sw = new Stopwatch(); @@ -1273,7 +1309,7 @@ namespace MP.Data.Services Log.Debug($"Init valore default | 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 } /// - /// Elenco Macchine dato operatore secondo gruppi (macchine/operatore) + /// Elenco MacchineModel dato operatore secondo gruppi (macchine/operatore) /// /// /// - public async Task> MacchineByMatrOper(int MatrOpr) + public async Task> 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 result = new List(); + List result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:MachByMatOp:{MatrOpr}"; RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else @@ -1462,7 +1498,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } sw.Stop(); diff --git a/MP.Land/Components/CmpCompType.razor.cs b/MP.Land/Components/CmpCompType.razor.cs index c9ed7b82..c908b657 100644 --- a/MP.Land/Components/CmpCompType.razor.cs +++ b/MP.Land/Components/CmpCompType.razor.cs @@ -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 diff --git a/MP.Land/Components/CmpGroupFilt.razor.cs b/MP.Land/Components/CmpGroupFilt.razor.cs index 5873b958..490c2dbd 100644 --- a/MP.Land/Components/CmpGroupFilt.razor.cs +++ b/MP.Land/Components/CmpGroupFilt.razor.cs @@ -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; } diff --git a/MP.Land/Components/CmpTop.razor.cs b/MP.Land/Components/CmpTop.razor.cs index 72290428..7522187d 100644 --- a/MP.Land/Components/CmpTop.razor.cs +++ b/MP.Land/Components/CmpTop.razor.cs @@ -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 diff --git a/MP.Land/Components/CompareAnagKeyVal.razor.cs b/MP.Land/Components/CompareAnagKeyVal.razor.cs index 693b0ad8..b79d1328 100644 --- a/MP.Land/Components/CompareAnagKeyVal.razor.cs +++ b/MP.Land/Components/CompareAnagKeyVal.razor.cs @@ -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 { diff --git a/MP.Land/Components/CompareConfig.razor.cs b/MP.Land/Components/CompareConfig.razor.cs index 2adcba63..7e4a7673 100644 --- a/MP.Land/Components/CompareConfig.razor.cs +++ b/MP.Land/Components/CompareConfig.razor.cs @@ -286,7 +286,7 @@ namespace MP.Land.Components [Inject] - protected MessageService AppMServ { get; set; } = null!; + protected LMessageService AppMServ { get; set; } = null!; public string searchVal { diff --git a/MP.Land/Components/CompareVocabolario.razor.cs b/MP.Land/Components/CompareVocabolario.razor.cs index d1844ca1..911e0329 100644 --- a/MP.Land/Components/CompareVocabolario.razor.cs +++ b/MP.Land/Components/CompareVocabolario.razor.cs @@ -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 { diff --git a/MP.Land/Components/HomeLink.razor b/MP.Land/Components/HomeLink.razor index 63020c01..92d0dd31 100644 --- a/MP.Land/Components/HomeLink.razor +++ b/MP.Land/Components/HomeLink.razor @@ -5,7 +5,7 @@ @inject IConfiguration Configuration @inject AppAuthService DataService -@inject MessageService MService +@inject LMessageService MService @inject LicenseService LicServ @if (authOk()) diff --git a/MP.Land/Components/SearchMod.razor b/MP.Land/Components/SearchMod.razor index 80d87327..90467d15 100644 --- a/MP.Land/Components/SearchMod.razor +++ b/MP.Land/Components/SearchMod.razor @@ -2,7 +2,7 @@ @using MP.Land.Data @using Majorsoft.Blazor.Components.Debounce -@inject MessageService MessageService +@inject LMessageService MessageService
diff --git a/MP.Land/Data/MessageService.cs b/MP.Land/Data/LMessageService.cs similarity index 98% rename from MP.Land/Data/MessageService.cs rename to MP.Land/Data/LMessageService.cs index 0e1fcf23..b48a6234 100644 --- a/MP.Land/Data/MessageService.cs +++ b/MP.Land/Data/LMessageService.cs @@ -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; diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index 7b249a09..b518a77d 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net6.0 MP.Land - 6.16.2505.2814 + 6.16.2506.2809 Debug;Release;Debug_LiManDebug en True diff --git a/MP.Land/Pages/About.razor b/MP.Land/Pages/About.razor index 1dc4795c..ca4de2bb 100644 --- a/MP.Land/Pages/About.razor +++ b/MP.Land/Pages/About.razor @@ -10,7 +10,7 @@

@Titolo

-
+
diff --git a/MP.Land/Pages/About.razor.cs b/MP.Land/Pages/About.razor.cs index c18f570c..9b90b66c 100644 --- a/MP.Land/Pages/About.razor.cs +++ b/MP.Land/Pages/About.razor.cs @@ -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 diff --git a/MP.Land/Pages/ConfSync.razor.cs b/MP.Land/Pages/ConfSync.razor.cs index f5873115..d7d601e3 100644 --- a/MP.Land/Pages/ConfSync.razor.cs +++ b/MP.Land/Pages/ConfSync.razor.cs @@ -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; } diff --git a/MP.Land/Pages/Contacts.razor b/MP.Land/Pages/Contacts.razor index 751452af..2187a0b7 100644 --- a/MP.Land/Pages/Contacts.razor +++ b/MP.Land/Pages/Contacts.razor @@ -1,7 +1,7 @@ @page "/Contacts" @using MP.Land.Data -@inject MessageService AppMService +@inject LMessageService AppMService
@@ -13,7 +13,7 @@

@Titolo

-
+
diff --git a/MP.Land/Pages/Index.razor.cs b/MP.Land/Pages/Index.razor.cs index b271e463..7ba100e4 100644 --- a/MP.Land/Pages/Index.razor.cs +++ b/MP.Land/Pages/Index.razor.cs @@ -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; } diff --git a/MP.Land/Pages/IobList.razor b/MP.Land/Pages/IobList.razor new file mode 100644 index 00000000..199ccfb5 --- /dev/null +++ b/MP.Land/Pages/IobList.razor @@ -0,0 +1,139 @@ +@page "/IobList" +
+
+
+
+
+
+
+ Ricerca + + +
+
+
+

@Titolo

+
+ +
+
+
+ @if (isLoading || ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { +
+
+ + + + + + + + + + + + + + + + + + + + + + @foreach (var item in ListRecords) + { + var cIobInfo = CurrIobInfo(item.IdxMacchina); + + + + + + + + + + + + + + + + + + } + + + + + + +
MacchinaIdxCodDescrLoc.RCNoteIOB TypeIOB IPIOB NameCountTipoVersDetail
@item.Nome@item.IdxMacchina@item.CodMacchina@item.Descrizione + @if (string.IsNullOrEmpty(item.Locazione)) + { + - + } + else + { + @item.Locazione + } + @item.RowNum@item.ColNum@item.Note@cIobInfo.iType@cIobInfo.IP@cIobInfo.name + @{ + string icnCol = cIobInfo.CNC_Counter ? "fa-solid fa-thumbs-up text-success" : "fa-solid fa-thumbs-down text-secondary"; + } + + @MacIobConf(item.IdxMacchina, "IobType")@MacIobConf(item.IdxMacchina, "IobVersion")AccordData + @*
+
+

+ +

+
+
+
    + @foreach (var item in MachineData) + { +
  • +
    +
    @item.Key
    +
    @item.Value
    +
    +
  • + } +
+
+
+
+
*@ + +
+ + +
+
+
+ } +
+ @* *@ +
+
+
diff --git a/MP.Land/Pages/IobList.razor.cs b/MP.Land/Pages/IobList.razor.cs new file mode 100644 index 00000000..32b5bebc --- /dev/null +++ b/MP.Land/Pages/IobList.razor.cs @@ -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 + + /// + /// Classe logger + /// + private static Logger Log = LogManager.GetCurrentClassLogger(); + + private List ListRecords = new List(); + private List SearchRecords = new List(); + private List AllRecords = new List(); + + 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 DictIobInfo = new Dictionary(); + protected Dictionary> DictMachData = new Dictionary>(); + + 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 + } +} \ No newline at end of file diff --git a/MP.Land/Pages/SysInfo.razor b/MP.Land/Pages/SysInfo.razor index 7f9f547d..8ba0b150 100644 --- a/MP.Land/Pages/SysInfo.razor +++ b/MP.Land/Pages/SysInfo.razor @@ -5,7 +5,7 @@ @using Microsoft.Extensions.Configuration @inject AppAuthService DataService -@inject MessageService AppMService +@inject LMessageService AppMService @inject IConfiguration Configuration
@@ -18,7 +18,7 @@

@Titolo

-
+
diff --git a/MP.Land/Pages/TaskScheduler.razor.cs b/MP.Land/Pages/TaskScheduler.razor.cs index 67403068..fae4081d 100644 --- a/MP.Land/Pages/TaskScheduler.razor.cs +++ b/MP.Land/Pages/TaskScheduler.razor.cs @@ -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 diff --git a/MP.Land/Pages/UpdateManager.razor.cs b/MP.Land/Pages/UpdateManager.razor.cs index 0190484e..91a509d7 100644 --- a/MP.Land/Pages/UpdateManager.razor.cs +++ b/MP.Land/Pages/UpdateManager.razor.cs @@ -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; } diff --git a/MP.Land/Pages/UserQr.razor.cs b/MP.Land/Pages/UserQr.razor.cs index 4a92581c..49f50c64 100644 --- a/MP.Land/Pages/UserQr.razor.cs +++ b/MP.Land/Pages/UserQr.razor.cs @@ -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 { diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index 2eb24261..99500df6 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo Tablet MAPO - DotNet6 -

Versione: 6.16.2505.2814

+

Versione: 6.16.2506.2809


Note di rilascio:
    diff --git a/MP.Land/Resources/VersNum.txt b/MP.Land/Resources/VersNum.txt index 23b36889..f6328f9f 100644 --- a/MP.Land/Resources/VersNum.txt +++ b/MP.Land/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2505.2814 +6.16.2506.2809 diff --git a/MP.Land/Resources/manifest.xml b/MP.Land/Resources/manifest.xml index 4a7eae81..0501e98d 100644 --- a/MP.Land/Resources/manifest.xml +++ b/MP.Land/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2505.2814 + 6.16.2506.2809 https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html false diff --git a/MP.Land/Shared/MainLayout.razor b/MP.Land/Shared/MainLayout.razor index aad77688..d3002fcb 100644 --- a/MP.Land/Shared/MainLayout.razor +++ b/MP.Land/Shared/MainLayout.razor @@ -3,7 +3,7 @@ @using MP.Land.Data @using MP.Land.Components -@inject MessageService AppMService +@inject LMessageService AppMService @inject LicenseService LicServ @implements IDisposable diff --git a/MP.Land/Shared/NavMenu.razor b/MP.Land/Shared/NavMenu.razor index 518b317a..e06bfc1e 100644 --- a/MP.Land/Shared/NavMenu.razor +++ b/MP.Land/Shared/NavMenu.razor @@ -40,6 +40,15 @@ }
+