Files
C2P/C2P_Data/DtProxy.cs
T
2014-02-24 10:48:00 +01:00

61 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SteamWare;
namespace C2P_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()
{
taQL = new DS_QuotesTableAdapters.QuoteListTableAdapter();
taQRM = new DS_QuotesTableAdapters.QuoteRMTableAdapter();
taVSCli = new DS_UtilityTableAdapters.v_selClientTableAdapter();
taVSItm = new DS_UtilityTableAdapters.v_selItemsTableAdapter();
taVSRM = new DS_UtilityTableAdapters.v_selRawMatTableAdapter();
}
/// <summary>
/// effettua setup dei connection strings da web.config della singola applicazione
/// </summary>
protected virtual void setupConnectionString()
{
string connStr = memLayer.ML.confReadString("C2PConnectionString");
// connections del db vocabolario
taQL.Connection.ConnectionString = connStr;
taQRM.Connection.ConnectionString = connStr;
taVSCli.Connection.ConnectionString = connStr;
taVSItm.Connection.ConnectionString = connStr;
taVSRM.Connection.ConnectionString = connStr;
}
#endregion
#region area public
public DS_QuotesTableAdapters.QuoteListTableAdapter taQL;
public DS_QuotesTableAdapters.QuoteRMTableAdapter taQRM;
public DS_UtilityTableAdapters.v_selClientTableAdapter taVSCli;
public DS_UtilityTableAdapters.v_selItemsTableAdapter taVSItm;
public DS_UtilityTableAdapters.v_selRawMatTableAdapter taVSRM;
public static DtProxy man = new DtProxy();
#endregion
}
}