/// <summary>
 /// Initialize the proper connection
 /// </summary>
 /// <param name="db">Connection type</param>
 public static void InitializeConnections(DatabaseType db)
 {
     if (db == DatabaseType.SQL)
     {
         SQLConnector sql = new SQLConnector();
         Connection = sql;
     }
     else if (db == DatabaseType.TXT)
     {
         TextFileConnector txt = new TextFileConnector();
         Connection = txt;
     }
 }
 public static void InitializeConnections(DatabaseType db)
 {
     if (db == DatabaseType.Sql)
     {
         //TODO: Set SQL connector properly
         SqlConnector sql = new SqlConnector();
         Connection = sql;
     }
     else if (db == DatabaseType.TextFile)
     {
         //TODO: create text file connection
         TextFileConnector text = new TextFileConnector();
         Connection = text;
     }
 }
Beispiel #3
0
        //TODO In future this can be modified to read YAML/Config file of some sort
        public static void InitializeConnection(DatabaseType connectionType)
        {
            switch (connectionType)
            {
            case DatabaseType.SQL:
                //TODO: Setup sql connection correctly
                SqlConnector sqlConnector = new SqlConnector();
                Connection = sqlConnector;
                break;

            case DatabaseType.TextFile:
                TextFileConnector textFileConnector = new TextFileConnector();
                Connection = textFileConnector;
                break;

            default:
                break;
            }
        }