public PanelDbView(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); Panel_Procedure = new PanelProcedure(DB, Logger) { Dock = DockStyle.Fill }; Panel_Sql = new PanelSql(DB, Logger) { Dock = DockStyle.Fill }; Panel_TableCreate = new PanelTableCreate(DB, Logger) { Dock = DockStyle.Fill }; Panel_TableData = new PanelTableData(DB, Logger) { Dock = DockStyle.Fill }; Panel_TableList = new PanelTableList(DB, Logger) { Dock = DockStyle.Fill }; Panel_Trigger = new PanelTrigger(DB, Logger) { Dock = DockStyle.Fill }; Panel_Procedure.OnProcedureRun += OnPocedureRun_ChangePanel; Panel_Sql.OnQuery += OnQuery_ChangePanel; Panel_TableCreate.OnTableCreate += OnTableCreate_ChangePanel; Panel_TableList.OnTableDelete += OnTableCreate_ChangePanel; Panel_TableList.OnTableClick += OnTableClick_ChangePanel; }
public FormProcedure(DBtool DB) { this.DB = DB; InitializeComponent(); table1.TableInit( new string[] { "Направление", "Имя", "Тип", "Размер", "" }, new float[] { 20, 20, 20, 20, 20 } ); AddRow(); }
public PanelTrigger(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); table_trigger.TableInit( new string[] { "Имя", "Время", "Событие", "Действия" }, new float[] { 20, 20, 20, 40 } ); }
public PanelProcedure(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); table_procedure.TableInit( new string[] { "Имя", "Тип", "Действия" }, new float[] { 25, 25, 50 } ); }
public PanelTableList(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); table_tablelist.TableInit( new string[] { "Таблица", "Сравнение", "Тип", "Строки", "Действия" }, new float[] { 30, 26, 12, 12, 20 } ); table_tablelist.RowClick += ClickTable; }
public PanelTableCreate(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); table1.TableInit( new string[] { "Имя", "Тип", "Размер", "Индекс", "Подпись" }, new float[] { 20, 20, 20, 20, 20 } ); AddRow(); }
private bool Authorisation() { FormConnect formConnect = new FormConnect(); formConnect.ShowDialog(); if (formConnect.DBConnection != null) { DB = formConnect.DBConnection; formConnect.Dispose(); return(true); } else { Dispose(); return(false); } }
private void connect_Click(object sender, EventArgs e) { string host; string username; string password; int port; string[] host_arr = input_host.Text.Trim().Split(new char[] { ':' }); switch (host_arr.Length) { case 1: port = 3306; break; case 2: try { port = int.Parse(host_arr[1].Trim()); } catch { Logger.Info("Неверный формат порта сервера"); return; } break; default: Logger.Info("Неверный формат адреса сервера"); return; } host = host_arr[0].Trim(); username = input_user.Text.Trim(); password = input_pass.Text.Trim(); if (save_login_check.Checked) { string auth_file_data = host + "\n" + port + "\n" + username + "\n" + password; try { using (StreamWriter sw = new StreamWriter("auth", false, System.Text.Encoding.UTF8)) { sw.WriteLine(auth_file_data); } } catch (Exception er) { Logger.Error(er.Message); } } DBtool DBConnection = new DBtool(host, username, password, port); if (DBConnection.ConnectError == "") { this._DBConnection = DBConnection; Close(); } else { label_status.Text = DBConnection.ConnectError; } }
public PanelTableData(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); }
public PanelDbCreate(DBtool database, Logger logger) { DB = database; Logger = logger; InitializeComponent(); }
public FormTrigger(DBtool DB) { this.DB = DB; InitializeComponent(); }