From accb74fe209b3a0f3c310b8bc9635198f12d8c84 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 20 Sep 2023 14:22:35 +0200 Subject: [PATCH] Update con LOG x salvataggio aprametri TAB --- MP-TAB/BasePage.cs | 137 +++++++++--------- MP-TAB/MP-TAB.csproj | 3 + MP-TAB/WebUserControls/BaseUserControl.cs | 3 + .../mod_sendParameters.ascx.cs | 3 + MapoDb/DataLayer.cs | 3 + 5 files changed, 82 insertions(+), 67 deletions(-) diff --git a/MP-TAB/BasePage.cs b/MP-TAB/BasePage.cs index 832693f4..a521bfca 100644 --- a/MP-TAB/BasePage.cs +++ b/MP-TAB/BasePage.cs @@ -1,23 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using MapoDb; +using MapoDb; +using NLog; using SteamWare; namespace MoonProTablet { public class BasePage : UserPage { - #region Internal Fields - - /// - /// Oggetto datalayer specifico - /// - internal DataLayer DataLayerObj = new DataLayer(); - - #endregion Internal Fields - #region Public Fields /// @@ -72,59 +60,6 @@ namespace MoonProTablet #endregion Public Fields - #region Protected Properties - - /// - /// Prox pagina da aprire - /// - protected string _nextPage - { - get - { - string pagina = memLayer.ML.StringSessionObj("nextPage"); - if (string.IsNullOrEmpty(pagina)) - { - pagina = "menu.aspx"; - } - return pagina; - } - } - - /// - /// Verifica se la macchina MAIN sia MASTER - /// - protected bool isMaster - { - get - { - return DataLayerObj.isMaster(idxMacchina); - } - } - - /// - /// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...) - /// - protected bool isMulti - { - get - { - return DataLayerObj.isMulti(idxMacchina); - } - } - - /// - /// Verifica se la macchina MAIN sia SLAVE - /// - protected bool isSlave - { - get - { - return DataLayerObj.isSlave(idxMacchina); - } - } - - #endregion Protected Properties - #region Public Properties /// @@ -208,5 +143,73 @@ namespace MoonProTablet } #endregion Public Methods + + #region Internal Fields + + /// + /// Oggetto datalayer specifico + /// + internal DataLayer DataLayerObj = new DataLayer(); + + #endregion Internal Fields + + #region Protected Properties + + /// + /// Prox pagina da aprire + /// + protected string _nextPage + { + get + { + string pagina = memLayer.ML.StringSessionObj("nextPage"); + if (string.IsNullOrEmpty(pagina)) + { + pagina = "menu.aspx"; + } + return pagina; + } + } + + /// + /// Verifica se la macchina MAIN sia MASTER + /// + protected bool isMaster + { + get + { + return DataLayerObj.isMaster(idxMacchina); + } + } + + /// + /// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...) + /// + protected bool isMulti + { + get + { + return DataLayerObj.isMulti(idxMacchina); + } + } + + /// + /// Verifica se la macchina MAIN sia SLAVE + /// + protected bool isSlave + { + get + { + return DataLayerObj.isSlave(idxMacchina); + } + } + + #endregion Protected Properties + + #region Private Fields + + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + + #endregion Private Fields } } \ No newline at end of file diff --git a/MP-TAB/MP-TAB.csproj b/MP-TAB/MP-TAB.csproj index 29a86159..835fb202 100644 --- a/MP-TAB/MP-TAB.csproj +++ b/MP-TAB/MP-TAB.csproj @@ -456,6 +456,9 @@ + + + diff --git a/MP-TAB/WebUserControls/BaseUserControl.cs b/MP-TAB/WebUserControls/BaseUserControl.cs index 5483bce4..33b150c4 100644 --- a/MP-TAB/WebUserControls/BaseUserControl.cs +++ b/MP-TAB/WebUserControls/BaseUserControl.cs @@ -1,4 +1,5 @@ using MapoDb; +using NLog; using SteamWare; using System; using System.IO; @@ -478,6 +479,8 @@ namespace MoonProTablet.WebUserControls #region Protected Fields + protected static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + /// /// indica conferma con rettifica (evento 121) /// diff --git a/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs b/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs index 44c68545..55319609 100644 --- a/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs +++ b/MP-TAB/WebUserControls/mod_sendParameters.ascx.cs @@ -1,6 +1,7 @@ using MapoDb; using MapoSDK; using NLog; +using NLog.Fluent; using SteamWare; using System; using System.Collections; @@ -59,6 +60,7 @@ namespace MoonProTablet.WebUserControls { if (memLayer.ML.CRB("sendParamLegacy")) { + Log.Info($"updateParameter | addTask4Machine | idxMacchina: {idxMacchina} | Original_uid: {Original_uid} | reqValue: {reqValue}"); // recupero items... List dcList = DataLayerObj.getCurrObjItems(idxMacchina); // cerco quello da aggiornare @@ -81,6 +83,7 @@ namespace MoonProTablet.WebUserControls } else { + Log.Info($"updateParameter | updateMachineParameter | idxMacchina: {idxMacchina} | Original_uid: {Original_uid} | reqValue: {reqValue}"); DataLayerObj.updateMachineParameter(idxMacchina, Original_uid, reqValue); } } diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index 61bfd8c1..c4354788 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -4062,6 +4062,7 @@ namespace MapoDb bool answ = false; if (innovations != null) { + Log.Info($"upsertCurrObjItems | idxMacchina: {idxMacchina} | {innovations.Count} innovations"); // leggo i valori attuali... List actValues = getCurrObjItems(idxMacchina); // per ogni valore passatomi faccio insert o update @@ -4074,11 +4075,13 @@ namespace MapoDb { // aggiungo innovations.Add(item); + Log.Info($"innovations | add | item.uid: {item.uid} | {item.value}"); } else // altrimenti aggiorno campi name... { trovato.name = item.name; + Log.Info($"innovations | update | item.uid: {item.uid} | {item.value}"); } } // serializzo e salvo