diff --git a/ETS_Data/ETS_Data.csproj b/ETS_Data/ETS_Data.csproj index c245a84..5d9e3b5 100644 --- a/ETS_Data/ETS_Data.csproj +++ b/ETS_Data/ETS_Data.csproj @@ -81,6 +81,9 @@ ..\PROJ-ETS\packages\DocumentFormat.OpenXml.2.7.2\lib\net46\DocumentFormat.OpenXml.dll + + ..\PROJ-ETS\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + ..\PROJ-ETS\packages\NLog.4.4.11\lib\net40\NLog.dll diff --git a/ETS_Data/packages.config b/ETS_Data/packages.config index d793f6f..92510af 100644 --- a/ETS_Data/packages.config +++ b/ETS_Data/packages.config @@ -1,6 +1,7 @@  + diff --git a/ETS_Data/utils.cs b/ETS_Data/utils.cs index 074bcb3..da9b078 100644 --- a/ETS_Data/utils.cs +++ b/ETS_Data/utils.cs @@ -7,9 +7,49 @@ using NLog; using System.Net.Mail; using System.Collections.Generic; using StackExchange.Redis; +using System.Data; +using Newtonsoft.Json; namespace ETS_Data { + /// + /// Helper methods e funzioni x gestione conversione dataset tipizzati e non + /// + /// A strongly type DataTable. + /// A DataTable of type T will be returned from the DataSet. + /// + public static class DataSetAdapter + where T : DataTable, new() + { + /// + /// Convert the first DataTable from a DataSet to a + /// strongly-typed data table. + /// + public static T convert(DataSet dataSet) + { + if (dataSet == null) + return null; + if (dataSet.Tables.Count == 0) + return null; + DataTable dataTable = dataSet.Tables[0]; + return convert(dataTable); + } + /// + /// Convert an ordinary DataTable to a strongly-typed + /// data table. + /// + public static T convert(DataTable dataTable) + { + if (dataTable == null) + return null; + T stronglyTyped = new T(); + // add data from the regular DataTable to the + // strongly typed DataTable. + stronglyTyped.Merge(dataTable, true, MissingSchemaAction.Ignore); + return stronglyTyped; + } + } + public class utils { protected AppSettingsReader configAppSetReader; @@ -111,8 +151,19 @@ namespace ETS_Data /// public static utils obj = new utils(); - #endregion + /// + /// Verifica se si debba serializzare ogni valore complesso (tabelle/righe) in sessione (per impiego di sessioni avanzate come Redis) + /// + public bool serializeSession + { + get + { + return confReadBool("serializeSession"); + } + } + #endregion + #region gestione email & log... /// @@ -314,6 +365,24 @@ namespace ETS_Data #region area Session + /// + /// carica dalla sessione un dato di tipo DataSet NON Tipizzato + /// + /// + /// + public DataSet dsSessionObj(string nomeVar) + { + if (HttpContext.Current.Session[nomeVar] != null) + { + string valSer = obj.StringSessionObj(nomeVar); + DataSet dataSet = JsonConvert.DeserializeObject(valSer); + return dataSet; + } + else + { + return null; + } + } /// /// carica dalla sessione un dato di tipo object generico /// @@ -460,8 +529,7 @@ namespace ETS_Data } #endregion - - + #region cache /// @@ -692,8 +760,7 @@ namespace ETS_Data } #endregion - - + #region gestione valori in RedisCache /// diff --git a/PROJ-ETS/PROJ-ETS/Bazaar.sitemap b/PROJ-ETS/PROJ-ETS/Bazaar.sitemap index c7e076b..3c07c6b 100644 --- a/PROJ-ETS/PROJ-ETS/Bazaar.sitemap +++ b/PROJ-ETS/PROJ-ETS/Bazaar.sitemap @@ -1,8 +1,9 @@  - - - - - + + + + + + \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj index ddb0638..9815cfa 100644 --- a/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj +++ b/PROJ-ETS/PROJ-ETS/PROJ-ETS.csproj @@ -84,6 +84,7 @@ + diff --git a/PROJ-ETS/PROJ-ETS/Reset.aspx b/PROJ-ETS/PROJ-ETS/Reset.aspx index d74e39c..1979f0e 100644 --- a/PROJ-ETS/PROJ-ETS/Reset.aspx +++ b/PROJ-ETS/PROJ-ETS/Reset.aspx @@ -12,6 +12,8 @@

Reset applicativo

+
+
diff --git a/PROJ-ETS/PROJ-ETS/Reset.aspx.cs b/PROJ-ETS/PROJ-ETS/Reset.aspx.cs index e73a12c..6591b79 100644 --- a/PROJ-ETS/PROJ-ETS/Reset.aspx.cs +++ b/PROJ-ETS/PROJ-ETS/Reset.aspx.cs @@ -12,7 +12,7 @@ namespace PROJ_ETS { protected void Page_Load(object sender, EventArgs e) { - //string paginaPrec = user_std.UtSn.pag; + string paginaPrec = user_std.pagPrecedente; string action = utils.obj.QSS("Action"); string nextPage = utils.obj.StringSessionObj("nextPage"); string testo = ""; @@ -20,14 +20,14 @@ namespace PROJ_ETS long recPost = 0; if (action != "") { - //if (action.Contains("C")) - //{ - // recPrev = Cache.Count; - // // reset dati in cache... - // utils.obj.flushRegisteredCache(); - // recPost = Cache.Count; - // testo += string.Format("
Reset Cache: {0} --> {1}
", recPrev, recPost); - //} + if (action.Contains("C")) + { + recPrev = Cache.Count; + // reset dati in cache... + utils.obj.flushRegisteredCache(); + recPost = Cache.Count; + testo += string.Format("
Reset Cache: {0} --> {1}
", recPrev, recPost); + } //if (action.Contains("D")) //{ // recPrev = utils.obj.numRecAppConf; @@ -52,19 +52,10 @@ namespace PROJ_ETS recPost = Session.Count; testo += string.Format("
Reset Sessione: {0} --> {1}
", recPrev, recPost); } - //if (action.Contains("V")) - //{ - // recPrev = DataWrap.DW.numRecVoc; - // // aggiorno vocabolario - // DataWrap.DW.resetVocabolario(); - // recPost = DataWrap.DW.numRecVoc; - // testo += string.Format("
Reset Vocabolario: {0} --> {1}
", recPrev, recPost); - //} } lblOut.Text = testo; if (nextPage != "") { - //logger.lg.scriviLog(string.Format("Reset {0} OK: redirect a pag {1}", action, nextPage), tipoLog.INFO); Response.Redirect(nextPage); } } diff --git a/PROJ-ETS/PROJ-ETS/Reset.aspx.designer.cs b/PROJ-ETS/PROJ-ETS/Reset.aspx.designer.cs index 85f7712..3f5af2f 100644 --- a/PROJ-ETS/PROJ-ETS/Reset.aspx.designer.cs +++ b/PROJ-ETS/PROJ-ETS/Reset.aspx.designer.cs @@ -29,5 +29,14 @@ namespace PROJ_ETS { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblOut; + + /// + /// Controllo hlHome. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HyperLink hlHome; } } diff --git a/PROJ-ETS/PROJ-ETS/Web.config b/PROJ-ETS/PROJ-ETS/Web.config index a4b786f..3e2f03a 100644 --- a/PROJ-ETS/PROJ-ETS/Web.config +++ b/PROJ-ETS/PROJ-ETS/Web.config @@ -131,7 +131,11 @@ - + + + + + @@ -210,6 +214,10 @@ + + + + \ No newline at end of file diff --git a/PROJ-ETS/PROJ-ETS/WebMasterPages/Bazaar.master.designer.cs b/PROJ-ETS/PROJ-ETS/WebMasterPages/Bazaar.master.designer.cs index 0a6167f..5e6e86f 100644 --- a/PROJ-ETS/PROJ-ETS/WebMasterPages/Bazaar.master.designer.cs +++ b/PROJ-ETS/PROJ-ETS/WebMasterPages/Bazaar.master.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ namespace PROJ_ETS.WebMasterPages { @@ -13,20 +13,20 @@ namespace PROJ_ETS.WebMasterPages { public partial class Bazaar { /// - /// mod_menuBazaar1 control. + /// Controllo mod_menuBazaar1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::PROJ_ETS.WebUserControls.mod_menuBazaar mod_menuBazaar1; /// - /// Contenuto control. + /// Controllo Contenuto. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ContentPlaceHolder Contenuto; } diff --git a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll index 9524b0a..e6bfc59 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll and b/PROJ-ETS/PROJ-ETS/bin/ETS_Data.dll differ diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll index 2e58fb2..f1d1cda 100644 Binary files a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll and b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll differ diff --git a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll.config b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll.config index a4b786f..3e2f03a 100644 --- a/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll.config +++ b/PROJ-ETS/PROJ-ETS/bin/PROJ-ETS.dll.config @@ -131,7 +131,11 @@ - + + + + + @@ -210,6 +214,10 @@ + + + + \ No newline at end of file