Files
GMW/GMW_data/Postazione.cs
T
Samuele Locatelli 61fc871483 vers 680
sterr taglio IN/OUT completata
2014-05-08 09:37:41 +02:00

219 lines
6.3 KiB
C#

using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GMW_data
{
/// <summary>
/// classe gestioen dati inerenti la postazione (fisica) da cui si esegue la pagina web
/// </summary>
public class Postazione
{
/// <summary>
/// indica stampante associata alla postazione corrente
/// </summary>
public static string printer
{
get
{
return memLayer.ML.StringSessionObj("postazione_printer");
}
set
{
memLayer.ML.setSessionVal("postazione_printer", value);
}
}
/// <summary>
/// indica name della postazione corrente
/// </summary>
public static string name
{
get
{
return memLayer.ML.StringSessionObj("postazione_name");
}
set
{
memLayer.ML.setSessionVal("postazione_name", value);
}
}
/// <summary>
/// indica ip della postazione corrente
/// </summary>
public static string IP
{
get
{
return memLayer.ML.StringSessionObj("postazione_IP");
}
set
{
memLayer.ML.setSessionVal("postazione_IP", value);
}
}
/// <summary>
/// warning text x la postazione corrente
/// </summary>
public static string warningText
{
get
{
return memLayer.ML.StringSessionObj("warningText");
}
set
{
memLayer.ML.setSessionVal("warningText", value);
}
}
/// <summary>
/// MESSAGGI text x la postazione corrente
/// </summary>
public static string messaggiText
{
get
{
return memLayer.ML.StringSessionObj("messaggiText");
}
set
{
memLayer.ML.setSessionVal("messaggiText", value);
}
}
/// <summary>
/// indica calsse css della postazione corrente
/// </summary>
public static string CssClass
{
get
{
return memLayer.ML.StringSessionObj("cssClass");
}
set
{
memLayer.ML.setSessionVal("cssClass", value);
}
}
/// <summary>
/// codice della linea corrente
/// </summary>
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);
}
}
/// <summary>
/// NOME della linea corrente
/// </summary>
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);
}
}
/// <summary>
/// idx cella associata alla linea corrente
/// </summary>
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);
}
}
/// <summary>
/// cod cella associata alla linea corrente
/// </summary>
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);
}
}
/// <summary>
/// definisce se mostrare lo storico
/// </summary>
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);
}
}
/// <summary>
/// effettua calcolo parametri postazione dato IP
/// </summary>
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
{ }
}
}
}