/// <summary> /// Vérifier la validation de la reuqête SQL /// </summary> /// <param name="incrementation"></param> public bool ValidateQuery(IncrementationDB incrementation) { DataBaseCreator db = new DataBaseCreator("db_cplus_validation"); db.InitialisationDatabase(); try { db.ExecutIncrementation(incrementation); this.SaveIncrementationDBToFile(incrementation); return(true); } catch (Exception ex) { throw new Exception(ex.Message); } }
//private static void StartIcon() //{ // var icon = new NotifyIcon(); // icon.Icon = new Icon("Icon.ico"); // icon.Visible = true; // icon.DoubleClick += new EventHandler(Icon_DoubleClick); // icon.Text = "Aura Server Console"; // ShowWindow(GetConsoleWindow(), showWindow ? 0 : 1); //} //private static void Icon_DoubleClick(object sender, EventArgs e) //{ // showWindow = !showWindow; // ShowWindow(GetConsoleWindow(), showWindow ? 0 : 1); //} private static void StartDataBases() { //настраиваем соединения с БД DataBaseCreator creator = new DataBaseCreator(); creator.CreateDataBaseForLogs(dbForLogsFileName); creator.CreateMainDataBase(dbFileName); creator.UpdateTables(dbFileName); creator = null; LogManager.Instance.InitializeLogManager(dbForLogsFileName); dataBase = new DataBaseManager(); dataBase.ConnectToDataBase(dbFileName); usersDataBase = new UsersTableAdapter(dataBase); purchasesDataBase = new PurchasesTableAdapter(dataBase); organisationsDataBase = new OrganisationsDataBaseAdapter(dataBase); reportsDataBaseAdapter = new ReportsDataBaseAdapter(dataBase); Console.WriteLine("Connection to DBs established successfully"); }