private void btnDangnhap_Click_1(object sender, EventArgs e) { tenmay = txtTenmay.Text.Trim().ToString(); DangNhapCl dnb = new DangNhapCl(); if (KetNoi.connectstat == true) { if (dnb.checklogin(txtTaiKhoan.Text, txtMatKhau.Text) == true) { quyen = dnb.getquyen(txtTaiKhoan.Text, txtMatKhau.Text); tendangnhap = dnb.gettendangnhap(txtTaiKhoan.Text, txtMatKhau.Text); frmMain fm = new frmMain(); fm.Show(); //MessageBox.Show("FormLogin: "******"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Hide(); } else { MessageBox.Show("Đăng Nhập Thất Bại", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { KetNoi.connectstat = true; } }
private void btnThoatDN_Click(object sender, EventArgs e) { if (KetNoi.connectstat == true) { DangNhapCl dnb = new DangNhapCl(); dnb.ngatkn(); } Application.Exit(); }