private void BtnAdd_Click(object sender, EventArgs e) { ConnectDB_SQL connectDB = new ConnectDB_SQL(); string sUser, sPass, sFullName; bool bAdmin = this.ckAdmin.Checked; bool bnam = this.radioButton_Nam.Checked; bool bnu = this.radioButton_Nu.Checked; sFullName = tbxFullName.Text; sUser = tbxUserName.Text; sPass = tbxPassword.Text; Boolean KQ = true; KQ = connectDB.Fun_Register(sFullName, sUser, sPass, bAdmin, bnam, bnu); if (KQ) { MessageBox.Show("Đăng ký thành công!!!"); } else { MessageBox.Show("Dang ky khong thanh cong!!"); } this.Hide(); Login lg = new Login(); lg.Show(); }
private void Button1_Click(object sender, EventArgs e) { ConnectDB_SQL connectDB = new ConnectDB_SQL(); string sUserName = txtUser.Text; string sPass = txtPassword.Text; Boolean result = true; result = connectDB.Fun_ConnectDB(sUserName, sPass); if (result) { MessageBox.Show("Đăng nhập thành công!✔ "); this.Hide(); Thaotac tt = new Thaotac(); tt.Show(); } else { MessageBox.Show("Đăng nhập thất bại! Mời nhập đăng nhập lại!⛔"); } }