Remove unneeded code that has been substituted by Entity Framework.

This commit is contained in:
2018-08-06 23:48:38 +01:00
parent 36bc2b694e
commit 83ba8cf568
74 changed files with 1 additions and 11251 deletions

View File

@@ -104,49 +104,6 @@ namespace Cicm.Database
connection = null;
}
/// <summary>
/// Creates a new database
/// </summary>
/// <param name="server">Server</param>
/// <param name="user">User</param>
/// <param name="database">Database name</param>
/// <param name="password">Password</param>
/// <param name="port">Port</param>
/// <returns><c>true</c> if database is created correctly, <c>false</c> otherwise</returns>
public bool CreateDb(string database, string server, string user, string password, ushort port = 3306)
{
try
{
string connectionString =
$"server={server};user={user};database={database};port={port};password={password}";
connection = new MySqlConnection(connectionString);
connection.Open();
IDbCommand command = connection.CreateCommand();
command.CommandText = $"CREATE DATABASE `{database}`;";
command.ExecuteNonQuery();
command.CommandText = $"USE `{database}`;";
command.ExecuteNonQuery();
Operations = new Operations(connection, this);
bool res = Operations.InitializeNewDatabase();
if(res) return true;
connection = null;
return false;
}
catch(MySqlException ex)
{
Console.WriteLine("Error opening database.");
Console.WriteLine(ex);
connection = null;
return false;
}
}
/// <summary>
/// Gets a data adapter for the opened database
/// </summary>