using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ETS_Data { /// /// classe proxy dati x ETS_WS /// public class DataProxy_ETS_WS { #region area table adapters /* DS_WebScip */ public DS_WebScipTableAdapters.tbDocumentiTableAdapter taDoc; /* DS_utilsWebScip */ public DS_utilsWebShipTableAdapters.v_selDocTableAdapter taVSD; /// /// init dei table adapters /// protected void initTA() { taDoc = new DS_WebScipTableAdapters.tbDocumentiTableAdapter(); taVSD = new DS_utilsWebShipTableAdapters.v_selDocTableAdapter(); } /// /// effettua setup dei connection strings da web.config delal singola applicazione /// protected virtual void setupConnectionStringBase() { // connections del db taDoc.Connection.ConnectionString = utils.obj.confReadString("ETS_WSConnectionString"); taVSD.Connection.ConnectionString = utils.obj.confReadString("ETS_WSConnectionString"); } #endregion protected DataProxy_ETS_WS() { initTA(); setupConnectionStringBase(); } /// /// Singleton accesso a DataProxy /// public static DataProxy_ETS_WS DP = new DataProxy_ETS_WS(); #region utility public esposte /// /// path completo (x download) di un doc (formato da "fullPath/nome") /// /// idxFile /// public string fullPathDoc(int idxFile) { string path = ""; try { DS_WebScip.tbDocumentiRow riga = taDoc.getByIdxFile(idxFile)[0]; path = string.Format("{0}/{1}", riga.fullPath, riga.Nome).Replace("//", "/"); } catch { } return path; } /// /// path completo (x download) di un doc (formato da "fullPath/nome") /// /// numero protocollo /// anno /// public string fullPathDoc(int numero, int anno) { string path = ""; try { DS_WebScip.tbDocumentiRow riga = taDoc.getByNrProto(numero, anno)[0]; path = string.Format("{0}/{1}", riga.fullPath, riga.Nome).Replace("//", "/"); } catch { } return path; } #endregion } }