} //= new IDataConnection(); public static void InitializeConnections(DatabaseType db) { /* * switch (db) * { * case DatabaseType.Sql: * break; * case DatabaseType.TextFile: * break; * default: * break; * } */ if (db == DatabaseType.Sql) { // TODO - Create the SQL connection SqlConnector sql = new SqlConnector(); Connection = sql; //Connections.Add(sql); } else if (db == DatabaseType.TextFile) { // TODO - Create the Text Connection TextConnector text = new TextConnector(); Connection = text; //Connections.Add(text); } }
public static void InitializeConnections(DatabaseType db) { switch (db) { case DatabaseType.Sql: break; case DatabaseType.TextFile: break; default: break; } if (db == DatabaseType.Sql) { SqlConnector sql = new SqlConnector(); Connection = sql; // do something } else if (db == DatabaseType.TextFile) { TextConnector text = new TextConnector(); Connection = text; // do something } }
public static void InitializeConnections(DatabaseType db) { switch (db) { case DatabaseType.Sql: SQLConnector sql = new SQLConnector(); Connection = sql; break; case DatabaseType.Textfile: TextConnector text = new TextConnector(); Connection = text; break; default: break; } /* if (db == DatabaseType.Sql) * { * // TODO - Setup the SQL Connector properly * SQLConnector sql = new SQLConnector(); * Connections = sql; * } * else if (db == DatabaseType.Textfile) * { * // TODO - Create the Text Connection * TextConnector text = new TextConnector(); * Connections = text; * }*/ }
public static void InitializeConnections(DatabaseType db) { // TODO: Turn into a switch statement //switch (db) //{ // case DatabaseType.Sql: // break; // case DatabaseType.TextFile: // break; // default: // break; //} if (db == DatabaseType.Sql) { // TODO - Set up the sql connector properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { // TODO - Create the text file connection TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnections(DatabaseType db) { /* switch statement if you need: * switch (db) * { * case DatabaseType.Sql: * break; * case DatabaseType.TextFile: * break; * default: * break; * } */ if (db == DatabaseType.Sql) { //TODO - create sql connection SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { //TODO - create textfile connection TextConnector text = new TextConnector(); Connection = text; } }
// public static void InitializeConnections(bool database, bool textFiles) public static void InitializeConnections(DatabaseType db) { //switch (db) //{ // case DatabaseType.Sql: // break; // case DatabaseType.TextFile: // break; // default: // break; //} //Connections = new List<IDataConnection>(); if (db == DatabaseType.Sql) //if(database==true) { //TODO - Create SQL Connection SqlConnector sql = new SqlConnector(); Connection = sql; //Connections.Add(sql); } else if (db == DatabaseType.TextFile) { //TODO - Create TEXT Connection TextConnector text = new TextConnector(); Connection = text; //Connections.Add(text); } }
public static void InitializeConnections(DatabaseType db) { //switch (db) //{ // case DatabaseType.Sql: // SqlConnector sql = new SqlConnector(); // Connections = sql; // break; // case DatabaseType.TextFile: // TextConnector text = new TextConnector(); // Connections = text; // break; // default: // break; //} if (db == DatabaseType.Sql) { //TODO - Setup the SQL Connector class properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { //TODO - Create the Text Connection TextConnector text = new TextConnector(); Connection = text; } }
public static void InitalizeConnections(DatabaseType db) { // Przyklad wczytania Enuma automatycznie 2 tab przy wczytywaniu switch 2 enter przy podawaniu parametru //switch (db) //{ // case DatabaseType.Sql: // break; // case DatabaseType.TextFile: // break; // default: // break; //} if (db == DatabaseType.Sql) { // TODO - Set up the SQL connector properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { //TODO - create the text connection TextConnector text = new TextConnector(); Connection = text; } }
// public static List<IDataConnection> Connections { get; private set; } = new List<IDataConnection>(); /// <summary> /// Maybe you will want to save to the both /// Oba tipa, i za baze i za tekstualne fajlove moze u ovu listu. /// Jer je u pitanju lista interfejsa. /// </summary> /// <param name="database"></param> /// <param name="textfiles"></param> //Before creating DatabaseType enum, //The parameters were bool database, bool textfiles public static void InitializeConnections(DatabaseType db) { // Instead of if-else, this is also a pretty option /* * switch (db) * { * case DatabaseType.Sql: * break; * case DatabaseType.TextFile: * break; * default: * break; * }*/ if (db == DatabaseType.Sql) { //TODO - Set up the SQL Connector properly SqlConnector sql = new SqlConnector(); // Connections.Add(sql); Connection = sql; } // now you only want to have one type of connection //before that it was only else, not else if //we are doing this because you want to escape the problem //of clashing ids in db and text file. else if (db == DatabaseType.TextFile) { //TODO - Create the Text Connection TextConnector text = new TextConnector(); // Connections.Add(text); Connection = text; } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { //TODO - setup the sql connector properly SQLConnector sql = new SQLConnector(); Connection = sql; } else if (db == DatabaseType.Textfile) { //TODO - setup the text connector properly TextConnector text = new TextConnector(); Connection = text; } /* * switch (db) * { * case DatabaseType.Sql: * break; * case DatabaseType.Textfile: * break; * default: * break; * } */ }
public static void InitializeConnection(DatabaseType db) { switch (db) { case DatabaseType.Sql: SqlConnector sql = new SqlConnector(); Connection = sql; break; case DatabaseType.TextFile: TextConnector text = new TextConnector(); Connection = text; break; default: break; } //if (db == DatabaseType.Sql) //{ // //TODO - Create the SQL Connector properly // SqlConnector sql = new SqlConnector(); // Connections = sql; //} //else if(db == DatabaseType.TextFile) //{ // //TODO - Create the Text Connection // TextConnector text = new TextConnector(); // Connections = text; //} }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.TextFile) { // TODO- Set up text connection properly TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnections(bool database, bool textFiles) { if (database) { var sql = new SqlConnector(); Connections.Add(sql); } else if (textFiles) { var txt = new TextConnector(); Connections.Add(txt); } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { TextConnector text = new TextConnector(); Connection = text; } }
// these are the connections to be setup public static void InitializeConnections(DatabaseType db) { // (database == true) is viable as well but we have a bool if (db == DatabaseType.Sql) { SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { //TODO - set up the SQL connector properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnections(bool database, bool textFiles) { if (database) { // TODO - Create the SQL Connection SqlConnector sql = new SqlConnector(); Connections.Add(sql); } if (textFiles) { // TODO - Create the Text Connection TextConnector text = new TextConnector(); Connections.Add(text); } }
public static void InitializeConnection(DataBaseType db) // { //Connections = new List<IDataConnection>(); // - initialing list before c# 6.0 if (DataBaseType.Sql == db) { SQLConnector sql = new SQLConnector(); Connection = sql; } else if (DataBaseType.TextFile == db) { TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnection(DatabaseType db) { if (db == DatabaseType.Sql) { //TODO- create the SQL connection SQLConnection sql = new SQLConnection(); Connection = sql; } else if (db == DatabaseType.TextFile) { //TODO - text file TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnection(DatabaseType db) { if (db == DatabaseType.Sql) { //TODO: setup SQL connector SQLConnector sql = new SQLConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { //TODO: setup Text connector TextConnector text = new TextConnector(); Connection = text; } }
public static void InitializeConnections(bool database, bool textFile) { if (database) { // TODO: setup the sql connector properly SQLConnector sql = new SQLConnector(); Connections.Add(sql); } if (textFile) { // TODO: setup the text connector properly TextConnector text = new TextConnector(); Connections.Add(text); } }
//so we use list because there can be more than one way to save data //plans have changed we use one of them. /// <summary> /// /// </summary> /// <param name="db"></param> public static void InitializeConnections(DatabaseType db) //bool bool to enum change { if (db == DatabaseType.Sql) { //TODO -vset up the SQL Connector properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { // TODO - Create the Text connection TextConnector txt = new TextConnector(); Connection = txt; } }
public static void InitializeComponents(bool database, bool textfile) { if (database) { // TODO - Create the SQL Connection. SqlConnector sql = new SqlConnector(); Connections.Add(sql); } if (textfile) { //TODO - Create the textfile Connection. TextConnector text = new TextConnector(); Connections.Add(text); } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { // TODO - Set up the SQL Connector properly SqlConnector sqlConn = new SqlConnector(); Connection = sqlConn; } else if (db == DatabaseType.TextFile) { // TODO - create the text file connection TextConnector textFileConn = new TextConnector(); Connection = textFileConn; } }
public static void InitializeConnections(bool database, bool textFiles) { if (database == true) { //TODO - Setup the SQL Connector properly SqlConnector sql = new SqlConnector(); Connections.Add(sql); } if (textFiles == true) { TextConnector text = new TextConnector(); Connections.Add(text); //TODO - Create the Text Connection } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { // TODO - Set up the SQL Connector SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) { // TODO - Create the Text Connection TextConnector text = new TextConnector(); Connection = text; } }
/// With that we actually can put in our list of connections any connection that implements this Interface /// <summary> /// Help the application to determine what kind of database source is /// actually available. /// </summary> /// <param name="database"></param> /// <param name="textfiles"></param> public static void InitializeConnections(DataBaseType db) { if (db == DataBaseType.Sql) { SqlConnector MySqlConnector = new SqlConnector(); Connection = MySqlConnector; } else if (db == DataBaseType.TextFile) { //TODO Create the Text Connection TextConnector MyTextConnector = new TextConnector(); Connection = MyTextConnector; } }
public static void InitializeConnections(DatabaseTypes db) { if (db == DatabaseTypes.Sql) { // Set up sql connecter properly var sql = new SqlConnector(); Connections = sql; } if (db == DatabaseTypes.TextFile) { // Create the Text Connections var text = new TextConnector(); Connections = text; } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { // TODO - Set up the Sql Connector properly SqlConnector sql = new SqlConnector(); Connection.Add(sql); } if (db == DatabaseType.TextFile) { //TODO -Create the Text Connection TextConnector text = new TextConnector(); Connection.Add(text); } }
public static void InitializeConnections(DatabaseType db) { if (db == DatabaseType.Sql) { //TODO set up SQL connector properly SqlConnector sql = new SqlConnector(); Connection = sql; } else if (db == DatabaseType.TextFile) //exactly one or another { //TODO text connection TextConnector text = new TextConnector(); Connection = text; } }