124 lines
4.3 KiB
C#
124 lines
4.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Web;
|
|
using SteamWare;
|
|
|
|
namespace XPS_data
|
|
{
|
|
/// <summary>
|
|
/// Summary description for XPS
|
|
/// </summary>
|
|
public class XPS
|
|
{
|
|
#region classe principale
|
|
|
|
/// <summary>
|
|
/// avvio classe
|
|
/// </summary>
|
|
protected XPS()
|
|
{
|
|
avvioTA();
|
|
setupConnectionStringBase();
|
|
}
|
|
/// <summary>
|
|
/// avvia table adapters
|
|
/// </summary>
|
|
private void avvioTA()
|
|
{
|
|
// avvio i table adapters...
|
|
taObj = new DS_applicazioneTableAdapters.IstObjTableAdapter();
|
|
taSP = new DS_applicazioneTableAdapters.SP();
|
|
taSchedaIdent = new DS_applicazioneTableAdapters.sp_schedaIdentTableAdapter();
|
|
taDdt = new DS_applicazioneTableAdapters.sp_ddtTableAdapter();
|
|
taRec4day = new XPS_data.DS_applicazioneTableAdapters.sp_rec4DayTableAdapter();
|
|
taComm = new XPS_data.DS_applicazioneTableAdapters.v_commesseTableAdapter();
|
|
taAnCli = new XPS_data.DS_applicazioneTableAdapters.AnagClientiTableAdapter();
|
|
}
|
|
/// <summary>
|
|
/// effettua setup dei connection strings da web.config delal singola applicazione
|
|
/// </summary>
|
|
protected virtual void setupConnectionStringBase()
|
|
{
|
|
string connString = memLayer.ML.confReadString("XPSConnectionString");
|
|
// connections strings del db
|
|
taObj.Connection.ConnectionString = connString;
|
|
//taSP.Connection.ConnectionString = connString;
|
|
taSchedaIdent.Connection.ConnectionString = connString;
|
|
taDdt.Connection.ConnectionString = connString;
|
|
taRec4day.Connection.ConnectionString = connString;
|
|
taComm.Connection.ConnectionString = connString;
|
|
taAnCli.Connection.ConnectionString = connString;
|
|
}
|
|
/// <summary>
|
|
/// singleton classe
|
|
/// </summary>
|
|
public static XPS obj = new XPS();
|
|
|
|
#endregion
|
|
|
|
#region area pubblica
|
|
|
|
#region table adapters
|
|
|
|
public DS_applicazioneTableAdapters.IstObjTableAdapter taObj;
|
|
public DS_applicazioneTableAdapters.SP taSP;
|
|
public DS_applicazioneTableAdapters.sp_schedaIdentTableAdapter taSchedaIdent;
|
|
public DS_applicazioneTableAdapters.sp_ddtTableAdapter taDdt;
|
|
public DS_applicazioneTableAdapters.sp_rec4DayTableAdapter taRec4day;
|
|
public DS_applicazioneTableAdapters.v_commesseTableAdapter taComm;
|
|
public DS_applicazioneTableAdapters.AnagClientiTableAdapter taAnCli;
|
|
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// restituisce l'url formattato del report x stampare etichette e moduli con barcode
|
|
/// </summary>
|
|
/// <param name="Cod"></param>
|
|
/// <param name="tipoReport">tipo di report (label, module ...)</param>
|
|
/// <param name="outputRich">tipo di output richiesto (PDF / anteprima)</param>
|
|
/// <returns></returns>
|
|
public string urlReport(object Cod, string tipoReport, string outputRich)
|
|
{
|
|
string url, urlFormat, opzPdf, nomeRep;
|
|
try
|
|
{
|
|
urlFormat = SteamWare.memLayer.ML.confReadString("urlReporting");
|
|
if (outputRich == "PDF")
|
|
{
|
|
opzPdf = SteamWare.memLayer.ML.confReadString("reportOpzPdf");
|
|
}
|
|
else
|
|
{
|
|
opzPdf = "";
|
|
}
|
|
if (tipoReport == "label")
|
|
{
|
|
nomeRep = SteamWare.memLayer.ML.confReadString("reportName_lbl");
|
|
}
|
|
else // (tipoReport == "module")
|
|
{
|
|
nomeRep = SteamWare.memLayer.ML.confReadString("reportName_mod");
|
|
}
|
|
url = string.Format(urlFormat, SteamWare.memLayer.ML.confReadString("reportingServerAddress"), SteamWare.memLayer.ML.confReadString("reportDir"), nomeRep, Cod, opzPdf);
|
|
}
|
|
catch
|
|
{
|
|
url = "";
|
|
}
|
|
return url;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
/// <summary>
|
|
/// modalità utente XPS Equa
|
|
/// </summary>
|
|
public enum modoXPS_Equa
|
|
{
|
|
magazzino,
|
|
spedizioni,
|
|
segreteria,
|
|
produzione,
|
|
direzione
|
|
}
|
|
} |