40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using TrackerLibrary.DataAccess;
|
|
using System.Configuration;
|
|
|
|
namespace TrackerLibrary
|
|
{
|
|
public static class GlobalConfig
|
|
{
|
|
public static IDataConnection Connection { get; private set; }
|
|
public static void InitializeConnections(DatabaseType db)
|
|
{
|
|
|
|
switch (db)
|
|
{
|
|
case DatabaseType.Sql:
|
|
// TODO - Set up the sql connector properly !
|
|
SqlConnector sql = new SqlConnector();
|
|
Connection = sql;
|
|
break;
|
|
case DatabaseType.TextFile:
|
|
// TODO - Create the text Connection
|
|
TextConnector text = new TextConnector();
|
|
Connection = text;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static string CnnString(string name)
|
|
{
|
|
return ConfigurationManager.ConnectionStrings[name].ConnectionString;
|
|
}
|
|
}
|
|
}
|