From 3fd157fdf1aebebda1f49fd6c47119e03d2945c4 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 2 Sep 2020 21:20:22 +0200 Subject: [PATCH] =?UTF-8?q?Aggiunta=20BaseUserControl=20x=20ereditariet?= =?UTF-8?q?=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPW_Smart/BaseUserControl.cs | 119 +++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 GPW_Smart/BaseUserControl.cs diff --git a/GPW_Smart/BaseUserControl.cs b/GPW_Smart/BaseUserControl.cs new file mode 100644 index 0000000..42d5e18 --- /dev/null +++ b/GPW_Smart/BaseUserControl.cs @@ -0,0 +1,119 @@ +using GPW_data; +using GPW_Smart; +using SteamWare; +using System; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace GPW_Smart +{ + public class BaseUserControl : System.Web.UI.UserControl + { + public string hashEmail + { + get + { + return memLayer.ML.StringSessionObj("hashEmail"); + } + } + public string email + { + get + { + return memLayer.ML.StringSessionObj("email"); + } + } + public string cognomeNome + { + get + { + return memLayer.ML.StringSessionObj("cognomeNome"); + } + } + public string IP + { + get + { + return Request.UserHostName; + } + } + + public int numColEU + { + get + { + return memLayer.ML.IntSessionObj("numColEU"); + } + set + { + memLayer.ML.setSessionVal("numColEU", value); + } + } + public int numRowTimb + { + get + { + return memLayer.ML.IntSessionObj("numRowTimb"); + } + set + { + memLayer.ML.setSessionVal("numRowTimb", value); + } + } + public bool abilitaAll + { + get + { + bool answ = false; + try + { + string rawData = memLayer.ML.getRSV("abilitaAll"); + bool.TryParse(rawData, out answ); + } + catch + { } + return answ; + } + set + { + int ttlSec = value ? memLayer.ML.CRI("ttlAbilitaAll") : 0; + memLayer.ML.setRSV("abilitaAll", value.ToString(), ttlSec); + } + } + public string textSize + { + get + { + string answ=memLayer.ML.StringSessionObj("textSize"); + if (string.IsNullOrEmpty(answ)) + answ = "1.2em"; + return answ; + } + set + { + memLayer.ML.setSessionVal("textSize", value); + } + } + /// + /// idx dipendente loggato + /// + protected int IdxDipendente + { + get + { + int idx = 0; + try + { + idx = memLayer.ML.IntSessionObj("IdxDipendente"); + } + catch + { } + return idx; + } + set + { + memLayer.ML.setSessionVal("IdxDipendente", value.ToString()); + } + } + } +} \ No newline at end of file