private void frmXuatDanhSachLop_Load(object sender, EventArgs e) { DataTable dt; DataTable dtLop; dt = nienKhoaBUS.GetTables("KhoaHoc"); cbKhoaHoc.DataSource = dt; cbKhoaHoc.DisplayMember = "NamHoc"; cbKhoaHoc.ValueMember = "IdKhoaHoc"; cbKhoaHoc.SelectedValue = 5; DataTable dtkhoi; dtkhoi = nienKhoaBUS.GetTables("Khoi"); cbKhoi.DataSource = dtkhoi; cbKhoi.DisplayMember = "TenKhoi"; cbKhoi.ValueMember = "MaKhoi"; cbKhoi.SelectedValue = 1; dtLop = LoadClassByGrade("1"); cbLop.DataSource = dtLop; cbLop.ValueMember = "MaLop"; cbLop.DisplayMember = "TenLop"; }
private void frmQLHocSinh_Load(object sender, EventArgs e) { this.Enabled = false; frmLogin frm = new frmLogin(); DialogResult resutl = frm.ShowDialog(); if (resutl == DialogResult.OK) { this.Enabled = true; this.Show(); txtNameUser.Text = Properties.Settings.Default.userName; } cbKhoaHoc.DropDownStyle = ComboBoxStyle.DropDownList; DataTable dt; dt = nienKhoaBUS.GetTables("KhoaHoc"); cbKhoaHoc.DataSource = dt; cbKhoaHoc.DisplayMember = "NamHoc"; cbKhoaHoc.ValueMember = "IdKhoaHoc"; // Load lớp theo khối LoadClassByGrade(); cbKhoaHoc.SelectedValue = 5; }