/// <summary>
        /// Nạp danh sách học viên
        /// </summary>
        public void InitializeHocVien()
        {
            gridDSHV.AutoGenerateColumns = false;

            Thread th = new Thread(() =>
            {
                object dshv = HocVien.SelectAll();

                gridDSHV.Invoke((MethodInvoker) delegate
                {
                    gridDSHV.DataSource = dshv;
                });
            });

            th.Start();
        }
        private void btnHienTatCa_Click(object sender, EventArgs e)
        {
            gridDSHV.AutoGenerateColumns = false;

            thHocVien = new Thread(() =>
            {
                //thPhieuGhiDanh.Join();

                object source = HocVien.SelectAll();

                gridDSHV.Invoke((MethodInvoker) delegate
                {
                    gridDSHV.DataSource = source;
                });
            });
            thHocVien.Start();
        }
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateSearch();

                if (rdMaHV.Checked)
                {
                    gridDSHV.DataSource = HocVien.SelectAll(txtMaHV.Text, null, null, null, null, null);
                }
                else if (rdTenHV.Checked)
                {
                    gridDSHV.DataSource = HocVien.SelectAll(null, txtTenHV.Text, null, null, null, null);
                }
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 4
0
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateSearch();

                gridDSHV.DataSource = HocVien.SelectAll(chkMaHV.Checked ? txtMaHV.Text : null,
                                                        chkTenHV.Checked ? txtTenHV.Text : null,
                                                        chkGioiTinh.Checked ? cboGioiTinh.Text : null,
                                                        chkNgayTiepNhan.Checked ? (DateTime?)dateTuNgay.Value : null,
                                                        chkNgayTiepNhan.Checked ? (DateTime?)dateDenNgay.Value : null,
                                                        cboLoaiHV.SelectedValue.ToString());
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
 private void btnXemTatCa_Click(object sender, EventArgs e)
 {
     gridDSHV.AutoGenerateColumns = false;
     gridDSHV.DataSource          = HocVien.SelectAll(cboLoaiHV.SelectedValue.ToString());
 }