using SteamWare; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GMW_data { /// /// classe gestioen dati inerenti la postazione (fisica) da cui si esegue la pagina web /// public class Postazione { /// /// indica stampante associata alla postazione corrente /// public static string printer { get { return memLayer.ML.StringSessionObj("postazione_printer"); } set { memLayer.ML.setSessionVal("postazione_printer", value); } } /// /// indica name della postazione corrente /// public static string name { get { return memLayer.ML.StringSessionObj("postazione_name"); } set { memLayer.ML.setSessionVal("postazione_name", value); } } /// /// indica ip della postazione corrente /// public static string IP { get { return memLayer.ML.StringSessionObj("postazione_IP"); } set { memLayer.ML.setSessionVal("postazione_IP", value); } } /// /// warning text x la postazione corrente /// public static string warningText { get { return memLayer.ML.StringSessionObj("warningText"); } set { memLayer.ML.setSessionVal("warningText", value); } } /// /// MESSAGGI text x la postazione corrente /// public static string messaggiText { get { return memLayer.ML.StringSessionObj("messaggiText"); } set { memLayer.ML.setSessionVal("messaggiText", value); } } /// /// indica calsse css della postazione corrente /// public static string CssClass { get { return memLayer.ML.StringSessionObj("cssClass"); } set { memLayer.ML.setSessionVal("cssClass", value); } } /// /// codice della linea corrente /// public static string currCodLinea { get { string answ = ""; if (memLayer.ML.isInSessionObject(string.Format("codLinea-{0}", Postazione.IP))) { answ = memLayer.ML.StringSessionObj(string.Format("codLinea-{0}", Postazione.IP)); } return answ; } set { memLayer.ML.setSessionVal(string.Format("codLinea-{0}", Postazione.IP), value); } } /// /// NOME della linea corrente /// public static string currNomeLinea { get { string answ = ""; if (memLayer.ML.isInSessionObject(string.Format("nomeLinea-{0}", Postazione.IP))) { answ = memLayer.ML.StringSessionObj(string.Format("nomeLinea-{0}", Postazione.IP)); } return answ; } set { memLayer.ML.setSessionVal(string.Format("nomeLinea-{0}", Postazione.IP), value); } } /// /// idx cella associata alla linea corrente /// public static int currIdxCella { get { int answ = 0; if (memLayer.ML.isInSessionObject(string.Format("IdxCella-{0}", Postazione.IP))) { answ = memLayer.ML.IntSessionObj(string.Format("IdxCella-{0}", Postazione.IP)); } return answ; } set { memLayer.ML.setSessionVal(string.Format("IdxCella-{0}", Postazione.IP), value); } } /// /// cod cella associata alla linea corrente /// public static string currCodCella { get { string answ = ""; if (memLayer.ML.isInSessionObject(string.Format("CodCella-{0}", Postazione.IP))) { answ = memLayer.ML.StringSessionObj(string.Format("CodCella-{0}", Postazione.IP)); } return answ; } set { memLayer.ML.setSessionVal(string.Format("CodCella-{0}", Postazione.IP), value); } } /// /// definisce se mostrare lo storico /// public static bool showStorico { get { bool answ = false; if (memLayer.ML.isInSessionObject("showHist")) { answ = memLayer.ML.BoolSessionObj("showHist"); } return answ; } set { memLayer.ML.setSessionVal("showHist", value); } } /// /// effettua calcolo parametri postazione dato IP /// public static void setupPrinter() { name = dnsUtils.DetermineCompName(IP); // cerco stampante x postazione printer = "n.d."; try { DS_Applicazione.ElencoPostazioniDataTable tabPost = DataProxy.obj.taElPost.getByCod(name); if (tabPost.Rows.Count > 0) { printer = tabPost[0].stampante; } else { tabPost = DataProxy.obj.taElPost.getByCod("default"); printer = tabPost[0].stampante; } } catch { } } } }