public Database() { Init.Init init = new Init.Init(); if (init.isSettings()) { init.Load(); directory_db = init.connecteurInfo.installation_dir + @"\" + DB_DOSSIER; connectionString = "Data Source=" + directory_db + @"\" + DB_NAME + "; Version=" + DB_VERSION; } if (!Directory.Exists(directory_db)) { Directory.CreateDirectory(directory_db); } if (!File.Exists(directory_db + @"\" + DB_NAME)) { SQLiteConnection.CreateFile(directory_db + @"\" + DB_NAME); } this.reprocessManager = new ReprocessManager(); this.alertMailLogManager = new AlertMailLogManager(); this.settingsManager = new SettingsManager(); this.connexionManager = new ConnexionManager(); this.emailManager = new EmailManager(); this.reliquatManager = new ReliquatManager(); }
public Database(StreamWriter writer) { Init.Init init = new Init.Init(); if (init.isSettings()) { init.Load_w_logs(writer); directory_db = init.connecteurInfo.installation_dir + @"\" + DB_DOSSIER; connectionString = "Data Source=" + directory_db + @"\" + DB_NAME + "; Version=" + DB_VERSION; } else { writer.WriteLine(""); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | Creation d'une instance"); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | "); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | Creation d'une instance"); } writer.WriteLine(""); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | Creation d'une instance"); if (!Directory.Exists(directory_db)) { Directory.CreateDirectory(directory_db); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | Creation du repertoire => " + directory_db); } if (!File.Exists(directory_db + @"\" + DB_NAME)) { SQLiteConnection.CreateFile(directory_db + @"\" + DB_NAME); writer.WriteLine(DateTime.Now + " :: Database.dll => Database() | Creation de la base de donnee => " + directory_db + @"\" + DB_NAME); } this.reprocessManager = new ReprocessManager(); this.alertMailLogManager = new AlertMailLogManager(); this.settingsManager = new SettingsManager(); this.connexionManager = new ConnexionManager(); this.emailManager = new EmailManager(); this.reliquatManager = new ReliquatManager(); writer.WriteLine(""); writer.Flush(); }