private void btnXepLichThi_Click(object sender, EventArgs e) { List <VerticeEntity> ListVertice = DsMonThi(); new Algorithm().Run(ListVertice, TimeEntity.GetAll); XuLyDataGridView.ShowData(ListVertice, grwDanhSach, "NGÀY", "GIỜ THI"); }
private void btnLoadFile_Click(object sender, EventArgs e) { DialogResult rs = openFileDialog.ShowDialog(); try { if (rs == DialogResult.OK) { grwDanhSach.Columns.Clear(); DataTable dt = Excel.Import(openFileDialog.FileName); grwDanhSach.DataSource = dt; grwDanhSach.Visible = true; DataGridViewComboBoxColumn objCol = XuLyDataGridView.CreateComboboxColumn("BẬC HỌC", XuLyXml.DocDsBacHoc()); grwDanhSach.Columns.Insert(3, objCol); DataGridViewCheckBoxColumn objChe = XuLyDataGridView.CreateCheckBoxColumn("THI PHÒNG MÁY"); grwDanhSach.Columns.Insert(4, objChe); grwDanhSach.Columns.RemoveAt(11); DataGridViewTextBoxColumn objtex = XuLyDataGridView.CreateTextboxColumn("PHÒNG THI"); grwDanhSach.Columns.Insert(11, objtex); DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("THÊM"); grwDanhSach.Columns.Insert(12, objbot); FormatColumn(); btnXepLichThi.Enabled = btnXuatExcel.Enabled = btnInKetQua.Enabled = true; } } catch (Exception) { } }
private void btnXepLichThi_Click(object sender, EventArgs e) { LenLichThi llt = new LenLichThi(DsMonThi(), GioThi.GetAll); if (llt.ThucHien()) { XuLyDataGridView.ShowData(llt.DsMonThiDaXep, grwDanhSach, "NGÀY", "GIỜ THI"); } }
private void btnChonNhom_Click(object sender, EventArgs e) { DataTable kq = XuLyDataGridView.GetTable(new string[] { "MÃ HP", "TÊN HỌC PHẦN", "LỚP", "NHÓM" }, (DataTable)grwDanhSach.DataSource); frmChonNhom fcn = new frmChonNhom(kq); if (fcn.ShowDialog() == DialogResult.OK) { XuLyDataGridView.ShowData(fcn.dgrDanhSach, grwDanhSach, "NHÓM", "NHÓM"); btnChonPhong.Enabled = btnXepLichThi.Enabled = true; } }
public frmChonNhom(DataGridView sou) { InitializeComponent(); dgrDanhSach.DataSource = source = sou; DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("CHỌN"); dgrDanhSach.Columns.Insert(5, objbot); dgrDanhSach.Columns[0].Width = 40; dgrDanhSach.Columns[6].Width = 50; dgrDanhSach.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }
private void btnChonPhong_Click(object sender, EventArgs e) { DataTable kq = XuLyDataGridView.GetTable(new string[] { "MÃ HP", "TÊN HỌC PHẦN", "SỐ SV", "HT THI", "PHÒNG" }, (DataTable)grwDanhSach.DataSource); MonXepPhong(kq); frmChonPhong fcp = new frmChonPhong(kq); if (fcp.ShowDialog() == DialogResult.OK) { XuLyDataGridView.ShowData(fcp.dgrDanhSach, grwDanhSach, "PHÒNG", "PHÒNG"); } }
public frmChonPhong(DataTable source) { InitializeComponent(); dgrDanhSach.DataSource = source; XuLyDataGridView.ReadOnly(dgrDanhSach); DataGridViewButtonColumn objbot = XuLyDataGridView.CreateButtonColumn("CHỌN"); dgrDanhSach.Columns.Insert(6, objbot); dgrDanhSach.Columns[0].Width = 40; dgrDanhSach.Columns[6].Width = 50; dgrDanhSach.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; }
private void btnLoadFile_Click(object sender, EventArgs e) { DialogResult rs = openFileDialog.ShowDialog(); try { if (rs == DialogResult.OK) { XuLyDataGridView.LoadData(grwDanhSach, openFileDialog.FileName); grwDanhSach.Columns[2].Width = 300; btnChonNhom.Enabled = btnXuatExcel.Enabled = btnInKetQua.Enabled = true; btnChonPhong.Enabled = btnXepLichThi.Enabled = false; ShowStatus("Load Dữ Liệu Thành Công"); } } catch (Exception) { BatLoi.ThongBao2("Lỗi! Không thể load dữ liệu từ file đã chọn"); } }