85 lines
2.4 KiB
C#
85 lines
2.4 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MP_SITE
|
|
{
|
|
public partial class test : System.Web.UI.Page
|
|
{
|
|
public resoconti _resoconti;
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
#if false
|
|
Stopwatch stopwatch = new Stopwatch();
|
|
logger.lg.scriviLog("inizio chart");
|
|
stopwatch.Restart();
|
|
_resoconti = new resoconti();
|
|
mod_sequencerStati.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100;
|
|
mod_sequencerStati.graphHeight = memLayer.ML.CRI("seq_height");
|
|
mod_sequencerStati.numSplit = memLayer.ML.CRI("seq_numSpl");
|
|
try
|
|
{
|
|
mod_sequencerStati.datiSequencer = _resoconti.sequenzaDati(mod_sequencerStati.identificativo, intervalloAnalisi);
|
|
logger.lg.scriviLog(string.Format("Letta tabella: {0} rec, {1} msec", mod_sequencerStati.datiSequencer.serieDati.Count, stopwatch.ElapsedMilliseconds));
|
|
mod_sequencerStati.doUpdate();
|
|
mod_sequencerStati.Visible = true;
|
|
logger.lg.scriviLog(string.Format("Creato grafico {0} msec", stopwatch.ElapsedMilliseconds));
|
|
}
|
|
catch
|
|
{
|
|
mod_sequencerStati.Visible = false;
|
|
}
|
|
#endif
|
|
|
|
if (!Page.IsPostBack)
|
|
{
|
|
setupMemHash();
|
|
}
|
|
}
|
|
|
|
public string hashKey
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.redHash("TestMem");
|
|
}
|
|
}
|
|
private void setupMemHash()
|
|
{
|
|
// scrivo 3 valori in redis DI DEFAULT
|
|
var listMemoria = new List<KeyValuePair<string, string>>();
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
listMemoria.Add(new KeyValuePair<string, string>(string.Format("key_{0}", i), i.ToString()));
|
|
}
|
|
|
|
// salvo vettori lingua CURR
|
|
memLayer.ML.redFlushKey(hashKey);
|
|
memLayer.ML.redSaveHashList(hashKey, listMemoria);
|
|
}
|
|
|
|
public intervalloDate intervalloAnalisi
|
|
{
|
|
get
|
|
{
|
|
intervalloDate answ = new intervalloDate()
|
|
{
|
|
inizio = Convert.ToDateTime("2018-05-1")
|
|
,
|
|
fine = Convert.ToDateTime("2018-05-30")
|
|
};
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
protected void lbtSave_Click(object sender, EventArgs e)
|
|
{
|
|
// effettua salvataggio HASH solo 1 valore
|
|
var listMemoria = new List<KeyValuePair<string, string>>();
|
|
int i = 1;
|
|
listMemoria.Add(new KeyValuePair<string, string>(string.Format("key_{0}", i), txtVal.Text));
|
|
memLayer.ML.redSaveHashList(hashKey, listMemoria);
|
|
}
|
|
}
|
|
}
|