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 { #region Protected Properties /// /// 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()); } } #endregion Protected Properties #region Public Properties 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 cognomeNome { get { return memLayer.ML.StringSessionObj("cognomeNome"); } } public string email { get { return memLayer.ML.StringSessionObj("email"); } } public string hashEmail { get { return memLayer.ML.StringSessionObj("hashEmail"); } } 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 string textSize { get { string answ = memLayer.ML.StringSessionObj("textSize"); if (string.IsNullOrEmpty(answ)) answ = "1.2em"; return answ; } set { memLayer.ML.setSessionVal("textSize", value); } } #endregion Public Properties #region Public Methods /// /// Verifica se il valore sia > limitValue /// /// /// /// /// public bool betweenVal(object _valore, double minVal, double maxVal) { bool answ = false; if (_valore != null) { double valore = 0; _ = double.TryParse(_valore.ToString(), out valore); answ = valore <= maxVal && valore >= minVal; } return answ; } /// /// Verifica se il valore sia > limitValue /// /// /// /// public bool gtVal(object _valore, double maxVal) { bool answ = false; if (_valore != null) { double valore = 0; _ = double.TryParse(_valore.ToString(), out valore); answ = valore > maxVal; } return answ; } public bool gtZero(object _valore) { bool answ = false; decimal valore = 0; decimal.TryParse(_valore.ToString(), out valore); answ = valore > 0; return answ; } #endregion Public Methods } }