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 @@