示例#1
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            KetNoi_CSDL.TaoKetNoi();
            dgrMH.DataSource = null;
            string sql5 = "Select * from MonHoc where MAMH like '%" + txtTimMH.Text + "%' or TENMH like '%" + txtTimMH.Text + "%' or SOTIET like '%" + txtTimMH.Text + "%'";

            dgrMH.DataSource = KetNoi_CSDL.LoadDuLieu(sql5, "MonHoc");
        }
示例#2
0
文件: frmLop.cs 项目: Thuyha1234/lt
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            KetNoi_CSDL.TaoKetNoi();
            dgrLop.DataSource = null;
            string sql4 = "Select * from Lop where MALOP like '%" + txtTimLop.Text + "%' or TENLOP like '%" + txtTimLop.Text + "%'";

            dgrLop.DataSource = KetNoi_CSDL.LoadDuLieu(sql4, "Lop");
        }
示例#3
0
文件: frmKhoa.cs 项目: Thuyha1234/lt
        private void btnTim_Click(object sender, EventArgs e)
        {
            KetNoi_CSDL.TaoKetNoi();
            dgrKhoa.DataSource = null;
            string sql6 = "Select * from Khoa where MAKHOA like '%" + txtTimKhoa.Text + "%' or TENKHOA like '%" + txtTimKhoa.Text + "%'";

            dgrKhoa.DataSource = KetNoi_CSDL.LoadDuLieu(sql6, "Khoa");
        }
示例#4
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            KetNoi_CSDL.TaoKetNoi();
            dgrKetQua.DataSource = null;
            string sql1 = "Select * from SinhVien where MASV like '%" + txtTimKiemSV.Text + "%' or TENSV like '%" + txtTimKiemSV.Text + "%' or SDT like '%" + txtTimKiemSV.Text + "%'";

            //string sql1 = "Select * from User where USERNAME like '%"+txtTimKiemSV.Text+"%'";
            dgrKetQua.DataSource = KetNoi_CSDL.LoadDuLieu(sql1, "SinhVien");
        }
示例#5
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "admin" && txtPassword.Text == "admin")
            {
                MessageBox.Show("Đăng nhập với tư cách quản trị viên");
                frmMainQLSV f20 = new frmMainQLSV();
                f20.Show();
                this.Hide();
            }
            else
            {
                KetNoi_CSDL.TaoKetNoi();
                string strSql = "Select COUNT(*) from NGUOIDUNG where TENDN = @ID  and MATKHAU = @PWD";

                OleDbCommand cmd = new OleDbCommand(strSql, KetNoi_CSDL.cnnQLSV);
                cmd.Parameters.AddWithValue("@ID", txtUsername.Text);
                cmd.Parameters.AddWithValue("@PWD", txtPassword.Text);

                this.Hide();

                if (Convert.ToBoolean(cmd.ExecuteScalar()))
                {
                    MessageBox.Show("Đăng nhập thành công");
                    frmSV fm = new frmSV();
                    fm.Show();
                    this.Hide();
                }

                else
                {
                    MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu");
                    this.Show();
                }
                // KetNoi_CSDL.Huy_KetNoi();
            }
        }
示例#6
0
 public frmTimKiemThongTinSV()
 {
     InitializeComponent();
     KetNoi_CSDL.TaoKetNoi();
 }