public TableNameForm(TablesEditorForm TblEditorForm, string oldNameTbl) { InitializeComponent(); tableEditorForm = TblEditorForm; oldNameTable = oldNameTbl; tbTblName.Text = oldNameTbl; this.Text = "Новое имя для " + oldNameTbl; }
private void btnAuth_Click(object sender, EventArgs e) { if (tbUser.Text.Length == 0 || tbPassword.Text.Length == 0) { MessageBox.Show("Заполните все поля"); } else { try { dbConn = new SQLiteConnection("Data Source=" + dbFileName + ";Version=3;"); dbConn.Open(); DataTable dTableUsers = new DataTable(); string sqlQueryUsers = "SELECT * FROM Accounts WHERE user_name = '" + tbUser.Text + "' AND user_password='******' AND isAdmin = true"; SQLiteDataAdapter adapter = new SQLiteDataAdapter(sqlQueryUsers, dbConn); adapter.Fill(dTableUsers); if (dTableUsers.Rows.Count < 1) { MessageBox.Show("Неверный логин/пароль, либо у вас отсутствуют права администратора"); } else { TablesEditorForm tablesEditor = new TablesEditorForm(dbConn); tablesEditor.Show(); this.Hide(); } } catch (SQLiteException ex) { MessageBox.Show("Ошибка: " + ex.Message); } } }
public TableNameForm(TablesEditorForm TblEditorForm) { InitializeComponent(); tableEditorForm = TblEditorForm; }