48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using TrackerLibrary.DataAccess;
|
|
using System.Configuration;
|
|
|
|
namespace TrackerLibrary
|
|
{
|
|
public static class GlobalConfig
|
|
{
|
|
|
|
public const string PrizesFile = "PrizeModels.csv";
|
|
public const string PeopleFile = "PersonModels.csv";
|
|
public const string TeamFile = "TeamModels.csv";
|
|
public const string TournamentFile = "TournamentModels.csv";
|
|
public const string MatchupFile = "MatchupModels.csv";
|
|
public const string MatchupEntryFile = "MatchupEntryModels.csv";
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|