diff --git a/GPW_Smart/ErrorPage.aspx.cs b/GPW_Smart/ErrorPage.aspx.cs
index 905e6d5..1432c22 100644
--- a/GPW_Smart/ErrorPage.aspx.cs
+++ b/GPW_Smart/ErrorPage.aspx.cs
@@ -1,5 +1,6 @@
using SteamWare;
using System;
+using System.Threading;
namespace GPW_Smart
{
@@ -7,10 +8,14 @@ namespace GPW_Smart
{
protected void Page_Load(object sender, EventArgs e)
{
- logger.lg.scriviLog(string.Format("Errore sollevato dalla pag {0} (prev: {1})", user_std.pagCorrente, user_std.pagPrecedente), tipoLog.INFO);
- memLayer.ML.setSessionVal("nextPage", "Default");
- memLayer.ML.setSessionVal("pagPrecedente", user_std.pagCorrente);
- Response.Redirect(memLayer.ML.confReadString("errorPageRedirect"));
+ string currPage = user_std.pagCorrente != "" ? user_std.pagCorrente : "Default";
+ string prevPage = user_std.pagPrecedente != "" ? user_std.pagPrecedente : "Default";
+ string errorPageRedirect = memLayer.ML.confReadString("errorPageRedirect");
+ memLayer.ML.setSessionVal("nextPage", currPage);
+ memLayer.ML.setSessionVal("pagPrecedente", prevPage);
+ logger.lg.scriviLog($"ErrorPage chiamata: currPage {currPage} | currPage: {currPage} --> Redirect a {errorPageRedirect}", tipoLog.INFO);
+ Thread.Sleep(50);
+ Response.Redirect(errorPageRedirect);
}
}
}
\ No newline at end of file
diff --git a/GPW_Smart/Reset.aspx.cs b/GPW_Smart/Reset.aspx.cs
index d81f67a..a16f3f5 100644
--- a/GPW_Smart/Reset.aspx.cs
+++ b/GPW_Smart/Reset.aspx.cs
@@ -18,42 +18,82 @@ namespace GPW_Smart
if (action.Contains("C"))
{
recPrev = Cache.Count;
- // reset dati in cache...
- memLayer.ML.flushRegisteredCache();
- recPost = Cache.Count;
- testo += string.Format("
Reset Cache: {0} --> {1}", recPrev, recPost);
+ if (recPrev > 0)
+ {
+ try
+ {
+ // reset dati in cache...
+ memLayer.ML.flushRegisteredCache();
+ recPost = Cache.Count;
+ testo += string.Format("
Reset Cache: {0} --> {1}", recPrev, recPost);
+ }
+ catch
+ { }
+ }
}
if (action.Contains("D"))
{
recPrev = memLayer.ML.numRecAppConf;
- // reset dati in cache x DbConfig...
- memLayer.ML.resetAppConf();
- recPost = memLayer.ML.numRecAppConf;
- testo += string.Format("
Reset DB AppConf: {0} --> {1}", recPrev, recPost);
+ if (recPrev > 0)
+ {
+ try
+ {
+ // reset dati in cache x DbConfig...
+ memLayer.ML.resetAppConf();
+ recPost = memLayer.ML.numRecAppConf;
+ testo += string.Format("
Reset DB AppConf: {0} --> {1}", recPrev, recPost);
+ }
+ catch
+ { }
+ }
}
if (action.Contains("R"))
{
recPrev = memLayer.ML.numRecRedis;
- // reset dati in cache x DbConfig...
- memLayer.ML.redFlushKey("**");
- recPost = memLayer.ML.numRecRedis;
- testo += string.Format("
Reset Redis: {0} --> {1}", recPrev, recPost);
+ if (recPrev > 0)
+ {
+ try
+ {
+ // reset dati in cache x DbConfig...
+ memLayer.ML.redFlushKey("**");
+ recPost = memLayer.ML.numRecRedis;
+ testo += string.Format("
Reset Redis: {0} --> {1}", recPrev, recPost);
+ }
+ catch
+ { }
+ }
}
if (action.Contains("S"))
{
recPrev = Session.Count;
- // reset dati in sessione...
- Session.Clear();
- recPost = Session.Count;
- testo += string.Format("
Reset Sessione: {0} --> {1}", recPrev, recPost);
+ if (recPrev > 0)
+ {
+ try
+ {
+ // reset dati in sessione...
+ Session.Clear();
+ recPost = Session.Count;
+ testo += string.Format("
Reset Sessione: {0} --> {1}", recPrev, recPost);
+ }
+ catch
+ { }
+ }
}
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);
+ if (recPrev > 0)
+ {
+ try
+ {
+ // aggiorno vocabolario
+ DataWrap.DW.resetVocabolario();
+ recPost = DataWrap.DW.numRecVoc;
+ testo += string.Format("
Reset Vocabolario: {0} --> {1}", recPrev, recPost);
+ }
+ catch
+ { }
+ }
}
}
lblOut.Text = testo;
diff --git a/GPW_Smart/WebUserControls/cmp_menuTop.ascx.cs b/GPW_Smart/WebUserControls/cmp_menuTop.ascx.cs
index a5409c8..f921601 100644
--- a/GPW_Smart/WebUserControls/cmp_menuTop.ascx.cs
+++ b/GPW_Smart/WebUserControls/cmp_menuTop.ascx.cs
@@ -36,6 +36,7 @@ namespace GPW_Smart.WebUserControls
{
if (!Page.IsPostBack)
{
+ checkPages();
searchVal = "";
ulLinks.DataBind();
}
@@ -55,6 +56,29 @@ namespace GPW_Smart.WebUserControls
lblSwData.Text = "GPW";
}
}
+ ///
+ /// Verifica le pagine x capire se siano cambiate...
+ ///
+ private void checkPages()
+ {
+ if (nomePagina != user_std.pagCorrente)
+ {
+ user_std.pagPrecedente = user_std.pagCorrente != "" ? user_std.pagCorrente : nomePagina;
+ user_std.pagCorrente = nomePagina;
+ }
+ }
+
+ ///
+ /// Nome pagina (parte finale url)
+ ///
+ public string nomePagina
+ {
+ get
+ {
+ return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", "");
+ }
+ }
+
///
/// verifica presenza utente autorizzato in sessione
///
@@ -201,12 +225,14 @@ namespace GPW_Smart.WebUserControls
public string cssActive(string pageName)
{
string answ = "";
- if (pageName == PagCorrente())
+ //if (pageName == PagCorrente())
+ if (pageName == nomePagina)
{
answ = "active";
}
return answ;
}
+#if false
///
/// salva in variabile pagina il nome della pagina corrente
///
@@ -220,11 +246,12 @@ namespace GPW_Smart.WebUserControls
char[] delimiter = delimStr.ToCharArray();
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
int n = finalUrl.Length;
- answ=finalUrl[n - 1].ToString();
+ answ = finalUrl[n - 1].ToString();
}
catch
{ }
return answ;
- }
+ }
+#endif
}
}
\ No newline at end of file