using System; using System.Collections.Generic; using System.Web; using SteamWare; namespace XPS_data { /// /// Summary description for XPS /// public class XPS { #region classe principale /// /// avvio classe /// protected XPS() { avvioTA(); setupConnectionStringBase(); } /// /// avvia table adapters /// 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(); } /// /// effettua setup dei connection strings da web.config delal singola applicazione /// 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; } /// /// singleton classe /// 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 /// /// restituisce l'url formattato del report x stampare etichette e moduli con barcode /// /// /// tipo di report (label, module ...) /// tipo di output richiesto (PDF / anteprima) /// 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 } /// /// modalità utente XPS Equa /// public enum modoXPS_Equa { magazzino, spedizioni, segreteria, produzione, direzione } }