using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using SteamWare; using GPW_data; using System.Globalization; using System.Data; namespace GPW_Admin { public class BaseUserControl : System.Web.UI.UserControl { /// /// effettua traduzione del lemma /// /// /// public string traduci(string lemma) { return user_std.UtSn.Traduci(lemma); } /// /// wrapper traduzione /// /// /// public string traduci(object lemma) { string answ = ""; if (lemma != null) answ = traduci(lemma.ToString()); return answ; } /// /// Verifica se il valore sia > 0 /// /// /// public bool gtZero(object _valore) { bool answ = false; if (_valore != null) { decimal valore = 0; _ = decimal.TryParse(_valore.ToString(), out valore); answ = valore > 0; } 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; } /// /// Verifica se il valore sia < minVal /// /// /// /// public bool ltVal(object _valore, double minVal) { bool answ = false; if (_valore != null) { double valore = 0; _ = double.TryParse(_valore.ToString(), out valore); answ = valore < minVal; } return answ; } /// /// 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; } } }