/// <summary> /// Load all class to combobox /// </summary> void LoadMaLop_DSLH() { if (listLop.Count == 0) { listLop = lopBLL.GetListLop(); } List <string> listMaLop = new List <string>(); foreach (Lop lop in listLop) { listMaLop.Add(lop.MaLop); } cbMaLop_DSLH.DataSource = listMaLop; }
private void GetListLop() { cboLop.DataSource = LopBLL.GetListLop(); cboLop.DisplayMember = "TenLop"; cboLop.ValueMember = "MaLop"; cboLop.Text = ""; }
private void LoadDataGridView() { dgvListLop.DataSource = LopBLL.GetListLop(); string[] listProp = { "CheckBox", "MaLop", "TenLop", "SiSo" }; ControlFormat.DataGridViewFormat(dgvListLop, listProp); dgvListLop.Columns["MaLop"].HeaderText = "Mã lớp"; dgvListLop.Columns["TenLop"].HeaderText = "Tên lớp"; dgvListLop.Columns["SiSo"].HeaderText = "Sỉ số"; }
private void btnFresh_Click(object sender, EventArgs e) { btnCapNhat.Enabled = false; listNienKhoa = LopBLL.GetListNienKhoa(); listLoaiLop = LopBLL.GetListLoaiLop(); listLop = LopBLL.GetListLop(); LoadValueInDGV(); Init(); }
private void frmQLChung_Lop_Load(object sender, EventArgs e) { btnCapNhat.Enabled = false; listNienKhoa = LopBLL.GetListNienKhoa(); listLoaiLop = LopBLL.GetListLoaiLop(); listLop = LopBLL.GetListLop(); LoadListGiaoVien(); LoadValueInDGV(); Init(); }
/// <summary> /// Load danh sach lop len combobox man hinh chuyen lop /// </summary> void LoadLop_CL() { if (listLop.Count == 0) { listLop = lopBLL.GetListLop(); } List <string> listmaLopCu = new List <string>(); List <string> listmaLopMoi = new List <string>(); foreach (Lop lop in listLop) { listmaLopCu.Add(lop.TenLop + " (" + lop.MaLop + ")"); listmaLopMoi.Add(lop.TenLop + " (" + lop.MaLop + ")"); } cbLopChuyenLopCu.DataSource = listmaLopCu; cbLop_ChuyenLop_Moi.DataSource = listmaLopMoi; }
private void loadListLop() { cboLop.Items.Clear(); cboLop.DisplayMember = "Text"; cboLop.ValueMember = "Value"; foreach (Lop lop in LopBLL.GetListLop(KeyHandle.GetKeyFromCombobox(cboNamHoc.SelectedItem.ToString()), KeyHandle.GetKeyFromCombobox(cboLoaiLop.SelectedItem.ToString()))) { cboLop.Items.Add(new { Text = lop.TenLop.Trim(), Value = lop.MaLop.Trim() }); } }
private void View_DiemNgoaiKhoa_Load(object sender, EventArgs e) { cboLop.DataSource = LopBLL.GetListLop(); cboLop.DisplayMember = "TenLop"; cboLop.ValueMember = "MaLop"; cboLop.Text = ""; cboHoatDong.DataSource = HoatDongNgoaiKhoaBLL.GetListHoatDong(); cboHoatDong.DisplayMember = "TenHoatDong"; cboHoatDong.ValueMember = "MaHoatDong"; cboHoatDong.Text = ""; }
private void btnCapNhat_Click(object sender, EventArgs e) { if (rdoQLLop.Checked) { if (LopBLL.CapNhatLop(txtMaLop.Text, txtTenLop.Text, cboGiangVien.Text)) { MessageBox.Show("Cập nhật lớp thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); listLop = LopBLL.GetListLop(); LoadDatagridView(); LoadValueInDGV(); } } else if (rdoQLLoaiLop.Checked) { if (LopBLL.CapNhatLoaiLop(txtMaLoaiLop.Text, txtTenLoaiLop.Text)) { MessageBox.Show("Cập nhật loại lớp thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); listLoaiLop = LopBLL.GetListLoaiLop(); listLop = LopBLL.GetListLop(); LoadDatagridView(); } } else if (rdoQuyDinh.Checked) { if (LopBLL.CapNhatSiSoToiDa(siSoToiDaHienTai, Convert.ToInt32(txtSiSoToiDa.Text))) { MessageBox.Show("Cập nhật sĩ số lớp tối đa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { if (LopBLL.CapNhatNienKhoa(txtMaNienKhoa.Text, txtTenNienKhoa.Text)) { MessageBox.Show("Cập nhật niên khóa thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); listNienKhoa = LopBLL.GetListNienKhoa(); listLop = LopBLL.GetListLop(); LoadDatagridView(); } } }
void Loadlophoc_Danhsachhocsinh() { List <Lop> listLophoc = lophoc.GetListLop(); //load source cac lop hoc len combobox tab-page bang diem mon hic List <string> listTenLophoc = new List <string>(); listTenLophoc.Add("tat ca cac lop"); foreach (Lop lop in listLophoc) { listTenLophoc.Add(lop.TenLop); } }
void LoadDSLopHoc() { List <Lop> listLop = lopbll.GetListLop(); List <string> nameClass = new List <string>(); //nameClass.Add("Chọn tất cả."); foreach (Lop lop in listLop) { nameClass.Add(lop.MaLop + "(" + lop.TenLop + ")"); } cbMaLop.DataSource = nameClass; }
public static void Lop(ComboBox cbo, ComboBox cboNamHoc, ComboBox cboLoaiLop) { cbo.Items.Clear(); cbo.DisplayMember = "Text"; cbo.ValueMember = "Value"; if (cboNamHoc.SelectedItem != null && cboLoaiLop.SelectedItem != null) { foreach (Lop lop in LopBLL.GetListLop(KeyHandle.GetKeyFromCombobox(cboNamHoc.SelectedItem.ToString()), KeyHandle.GetKeyFromCombobox(cboLoaiLop.SelectedItem.ToString()))) { cbo.Items.Add(new { Text = lop.TenLop.Trim(), Value = lop.MaLop.Trim() }); } } cbo.Text = ""; }
void ThemLop(string maLop, string maLoaiLop, string maNienKhoa, string maGV, string tenLop) { if (LopBLL.ThemLop(maLop, maLoaiLop, maNienKhoa, maGV, tenLop)) { MessageBox.Show("Thêm lớp thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); listLop = LopBLL.GetListLop(); LoadDatagridView(); } }
public void getComboboxLop() { cboLop.DataSource = LopBLL.GetListLop(LopBLL.getMaNamHoc(dtpNgay_Loc.Value), cboLoaiLop.SelectedValue.ToString().Trim()); cboLop.DisplayMember = "TenLop"; cboLop.ValueMember = "MaLop"; }