117 lines
4.3 KiB
C#
117 lines
4.3 KiB
C#
using SteamWare;
|
|
using System;
|
|
|
|
namespace GPW_Smart
|
|
{
|
|
public partial class Reset : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
string paginaPrec = user_std.pagPrecedente;
|
|
string action = memLayer.ML.QSS("Action");
|
|
string nextPage = memLayer.ML.StringSessionObj("nextPage");
|
|
string testo = "";
|
|
long recPrev = 0;
|
|
long recPost = 0;
|
|
if (!string.IsNullOrEmpty(action))
|
|
{
|
|
if (action.Contains("C"))
|
|
{
|
|
recPrev = Cache.Count;
|
|
if (recPrev > 0)
|
|
{
|
|
try
|
|
{
|
|
// reset dati in cache...
|
|
memLayer.ML.flushRegisteredCache();
|
|
recPost = Cache.Count;
|
|
testo += string.Format("<hr/>Reset Cache: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
if (action.Contains("D"))
|
|
{
|
|
recPrev = memLayer.ML.numRecAppConf;
|
|
if (recPrev > 0)
|
|
{
|
|
try
|
|
{
|
|
// reset dati in cache x DbConfig...
|
|
memLayer.ML.resetAppConf();
|
|
recPost = memLayer.ML.numRecAppConf;
|
|
testo += string.Format("<hr/>Reset DB AppConf: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
if (action.Contains("R"))
|
|
{
|
|
recPrev = memLayer.ML.numRecRedis;
|
|
if (recPrev > 0)
|
|
{
|
|
try
|
|
{
|
|
// reset dati in cache x DbConfig...
|
|
memLayer.ML.redFlushKey("**");
|
|
recPost = memLayer.ML.numRecRedis;
|
|
testo += string.Format("<hr/>Reset Redis: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
if (action.Contains("S"))
|
|
{
|
|
recPrev = Session.Count;
|
|
if (recPrev > 0)
|
|
{
|
|
try
|
|
{
|
|
// reset dati in sessione...
|
|
Session.Clear();
|
|
recPost = Session.Count;
|
|
testo += string.Format("<hr/>Reset Sessione: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
if (action.Contains("V"))
|
|
{
|
|
recPrev = DataWrap.DW.numRecVoc;
|
|
if (recPrev > 0)
|
|
{
|
|
try
|
|
{
|
|
// aggiorno vocabolario
|
|
DataWrap.DW.resetVocabolario();
|
|
recPost = DataWrap.DW.numRecVoc;
|
|
testo += string.Format("<hr/>Reset Vocabolario: {0} --> {1}</br>", recPrev, recPost);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
}
|
|
lblOut.Text = testo;
|
|
if (!string.IsNullOrEmpty(nextPage))
|
|
{
|
|
logger.lg.scriviLog(string.Format("Reset {0} OK: redirect a pag {1}", action, nextPage), tipoLog.INFO);
|
|
Response.Redirect(nextPage);
|
|
}
|
|
else if (!string.IsNullOrEmpty(paginaPrec))
|
|
{
|
|
logger.lg.scriviLog(string.Format("Reset {0} OK: redirect a pag {1}", action, paginaPrec), tipoLog.INFO);
|
|
Response.Redirect(nextPage);
|
|
}
|
|
else
|
|
{
|
|
logger.lg.scriviLog(string.Format("Reset {0} OK: redirect a pag {1}", action, "Default"), tipoLog.INFO);
|
|
Response.Redirect("Default");
|
|
}
|
|
}
|
|
}
|
|
} |