92 lines
2.7 KiB
C#
92 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace ETS_Data
|
|
{
|
|
|
|
/// <summary>
|
|
/// classe proxy dati x ETS_WS
|
|
/// </summary>
|
|
public class DataProxy_ETS_WS
|
|
{
|
|
#region area table adapters
|
|
|
|
/* DS_WebScip */
|
|
public DS_WebScipTableAdapters.tbDocumentiTableAdapter taDoc;
|
|
/* DS_utilsWebScip */
|
|
public DS_utilsWebShipTableAdapters.v_selDocTableAdapter taVSD;
|
|
|
|
/// <summary>
|
|
/// init dei table adapters
|
|
/// </summary>
|
|
protected void initTA()
|
|
{
|
|
taDoc = new DS_WebScipTableAdapters.tbDocumentiTableAdapter();
|
|
taVSD = new DS_utilsWebShipTableAdapters.v_selDocTableAdapter();
|
|
}
|
|
/// <summary>
|
|
/// effettua setup dei connection strings da web.config delal singola applicazione
|
|
/// </summary>
|
|
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();
|
|
}
|
|
/// <summary>
|
|
/// Singleton accesso a DataProxy
|
|
/// </summary>
|
|
public static DataProxy_ETS_WS DP = new DataProxy_ETS_WS();
|
|
|
|
#region utility public esposte
|
|
|
|
/// <summary>
|
|
/// path completo (x download) di un doc (formato da "fullPath/nome")
|
|
/// </summary>
|
|
/// <param name="idxFile">idxFile</param>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
/// <summary>
|
|
/// path completo (x download) di un doc (formato da "fullPath/nome")
|
|
/// </summary>
|
|
/// <param name="numero">numero protocollo</param>
|
|
/// <param name="anno">anno</param>
|
|
/// <returns></returns>
|
|
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
|
|
}
|
|
}
|