private void btnXoa_Click(object sender, EventArgs e)
        {
            string sql1;

            sql1  = "SELECT * FROM khachhang";
            tblKH = DAO.GetDataToTable(sql1);
            string sql;

            if (tblKH.Rows.Count == 0)
            {
                MessageBox.Show("Không còn dữ liệu!", "Thông báo", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }
            if (txtmakhach.Text == "")
            {
                MessageBox.Show("Bạn chưa chọn bản ghi nào", "Thông báo",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("Bạn có muốn xóa không?", "Thông báo",
                                MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                sql = "DELETE khachhang WHERE makhach=N'" + txtmakhach.Text + "'";
                DAO.RunSqlDel(sql);
                hienthi();
                ResetValues();
            }
        }
        private void btnSua_Click(object sender, EventArgs e)
        {
            string sql1;

            sql1  = "SELECT * FROM khachhang";
            tblKH = DAO.GetDataToTable(sql1);
            string sql;

            if (tblKH.Rows.Count == 0)
            {
                MessageBox.Show("Không còn dữ liệu!", "Thông báo", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }
            else
            {
                if (txtmakhach.Text == "")
                {
                    MessageBox.Show("Bạn chưa chọn bản ghi nào", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (txttenkhach.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Bạn phải nhập tên khách", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txttenkhach.Focus();
                    return;
                }
                if (txtngaysinh.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Bạn phải nhập ngày sinh", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txttenkhach.Focus();
                    return;
                }
                if (txtgioitinh.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Bạn phải nhập giới tính", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txttenkhach.Focus();
                    return;
                }
                if (txtdiachi.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Bạn phải nhập địa chỉ", "Thông báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txttenkhach.Focus();
                    return;
                }
            }
            sql = "UPDATE khachhang SET tenkhach=N'" + txttenkhach.Text.ToString() + "',ngaysinh=N'" + txtngaysinh.Text.ToString() + "',gioitinh=N'" + txtgioitinh.Text.ToString() + "',diachi=N'" + txtdiachi.Text.ToString() + "' WHERE makhach=N'" + txtmakhach.Text + "'";
            DAO.RunSql(sql);
            hienthi();
            ResetValues();
            btnHuy.Enabled = false;
        }