142 lines
5.6 KiB
C#
142 lines
5.6 KiB
C#
using SteamWare;
|
|
|
|
namespace CMS_SC_Data
|
|
{
|
|
public class DtProxy
|
|
{
|
|
#region area protected
|
|
|
|
protected DtProxy()
|
|
{
|
|
// inizializzo i table adapters
|
|
avvioTableAdapters();
|
|
setupConnectionString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// procedura di avvio dei tableAdapter
|
|
/// </summary>
|
|
protected virtual void avvioTableAdapters()
|
|
{
|
|
taAF = new DS_ApplicazioneTableAdapters.AnagFasiTableAdapter();
|
|
taASC = new DS_ApplicazioneTableAdapters.AnagSchedeTableAdapter();
|
|
taAT = new DS_ApplicazioneTableAdapters.AnagTagsTableAdapter();
|
|
taDS = new DS_ApplicazioneTableAdapters.DettSchedaTableAdapter();
|
|
taED = new DS_ApplicazioneTableAdapters.ElencoDossierTableAdapter();
|
|
taEFM = new DS_ApplicazioneTableAdapters.ElencoFamMaccTableAdapter();
|
|
taEM = new DS_ApplicazioneTableAdapters.ElencoMacchineCNTableAdapter();
|
|
taFRGL = new DS_ApplicazioneTableAdapters.FRGLTableAdapter();
|
|
taMis = new DS_ApplicazioneTableAdapters.MisureTableAdapter();
|
|
taRep = new DS_ApplicazioneTableAdapters.ReportDataTableAdapter();
|
|
taSCFM = new DS_ApplicazioneTableAdapters.SchemaCollFamMaccTableAdapter();
|
|
taSCM = new DS_ApplicazioneTableAdapters.SchemaCollMaccTableAdapter();
|
|
taT2M = new DS_ApplicazioneTableAdapters.Tags2MacchineTableAdapter();
|
|
taUsrPar = new DS_ApplicazioneTableAdapters.UserParamTableAdapter();
|
|
taVV = new DS_ApplicazioneTableAdapters.ValidValTableAdapter();
|
|
taFiles = new DS_UtilityTableAdapters.tblFilesTableAdapter();
|
|
taListVal = new DS_UtilityTableAdapters.ListValuesTableAdapter();
|
|
taVoc = new DS_UtilityTableAdapters.VocabolarioTableAdapter();
|
|
taVSMacc = new DS_UtilityTableAdapters.v_selMacchineTableAdapter();
|
|
taVSR = new DS_UtilityTableAdapters.v_selRevTableAdapter();
|
|
}
|
|
/// <summary>
|
|
/// effettua setup dei connection strings da web.config della singola applicazione
|
|
/// </summary>
|
|
protected virtual void setupConnectionString()
|
|
{
|
|
string connStr = memLayer.ML.confReadString("CMS_SCConnectionString");
|
|
//string connStrFiles = memLayer.ML.confReadString("WebSCRFilesConnectionString");
|
|
// connections del db vocabolario
|
|
taAF.Connection.ConnectionString = connStr;
|
|
taASC.Connection.ConnectionString = connStr;
|
|
taAT.Connection.ConnectionString = connStr;
|
|
taDS.Connection.ConnectionString = connStr;
|
|
taED.Connection.ConnectionString = connStr;
|
|
taEFM.Connection.ConnectionString = connStr;
|
|
taEM.Connection.ConnectionString = connStr;
|
|
taFRGL.Connection.ConnectionString = connStr;
|
|
taMis.Connection.ConnectionString = connStr;
|
|
taRep.Connection.ConnectionString = connStr;
|
|
taSCFM.Connection.ConnectionString = connStr;
|
|
taSCM.Connection.ConnectionString = connStr;
|
|
taT2M.Connection.ConnectionString = connStr;
|
|
taUsrPar.Connection.ConnectionString = connStr;
|
|
taVV.Connection.ConnectionString = connStr;
|
|
taFiles.Connection.ConnectionString = connStr;
|
|
taListVal.Connection.ConnectionString = connStr;
|
|
taVoc.Connection.ConnectionString = connStr;
|
|
taVSMacc.Connection.ConnectionString = connStr;
|
|
taVSR.Connection.ConnectionString = connStr;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region area public
|
|
|
|
public DS_ApplicazioneTableAdapters.AnagFasiTableAdapter taAF;
|
|
public DS_ApplicazioneTableAdapters.AnagSchedeTableAdapter taASC;
|
|
public DS_ApplicazioneTableAdapters.AnagTagsTableAdapter taAT;
|
|
public DS_ApplicazioneTableAdapters.DettSchedaTableAdapter taDS;
|
|
public DS_ApplicazioneTableAdapters.ElencoDossierTableAdapter taED;
|
|
public DS_ApplicazioneTableAdapters.ElencoFamMaccTableAdapter taEFM;
|
|
public DS_ApplicazioneTableAdapters.ElencoMacchineCNTableAdapter taEM;
|
|
public DS_ApplicazioneTableAdapters.FRGLTableAdapter taFRGL;
|
|
public DS_ApplicazioneTableAdapters.MisureTableAdapter taMis;
|
|
public DS_ApplicazioneTableAdapters.ReportDataTableAdapter taRep;
|
|
public DS_ApplicazioneTableAdapters.SchemaCollFamMaccTableAdapter taSCFM;
|
|
public DS_ApplicazioneTableAdapters.SchemaCollMaccTableAdapter taSCM;
|
|
public DS_ApplicazioneTableAdapters.Tags2MacchineTableAdapter taT2M;
|
|
public DS_ApplicazioneTableAdapters.UserParamTableAdapter taUsrPar;
|
|
public DS_ApplicazioneTableAdapters.ValidValTableAdapter taVV;
|
|
public DS_UtilityTableAdapters.tblFilesTableAdapter taFiles;
|
|
public DS_UtilityTableAdapters.ListValuesTableAdapter taListVal;
|
|
public DS_UtilityTableAdapters.VocabolarioTableAdapter taVoc;
|
|
public DS_UtilityTableAdapters.v_selMacchineTableAdapter taVSMacc;
|
|
public DS_UtilityTableAdapters.v_selRevTableAdapter taVSR;
|
|
|
|
public static DtProxy man = new DtProxy();
|
|
|
|
|
|
/// <summary>
|
|
/// formatta URL completo
|
|
/// </summary>
|
|
/// <param name="docPath"></param>
|
|
/// <returns></returns>
|
|
public static string getDocPath(object docPath)
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
answ = string.Format(memLayer.ML.confReadString("urlSchede"), docPath);
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// verifica se CI SIA il documento...
|
|
/// </summary>
|
|
/// <param name="docPath">The document path.</param>
|
|
/// <returns></returns>
|
|
public static bool notNullDocPath(object docPath)
|
|
{
|
|
bool answ = false;
|
|
string docFilePath = "";
|
|
if (docPath.ToString().Trim() != "")
|
|
{
|
|
try
|
|
{
|
|
docFilePath = string.Format(memLayer.ML.confReadString("urlSchede"), docPath);
|
|
answ = fileMover.obj.fileExist(docFilePath.Replace(docPath.ToString(), ""), docPath.ToString());
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
}
|