コード例 #1
0
        /// <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;
        }
コード例 #2
0
 private void GetListLop()
 {
     cboLop.DataSource    = LopBLL.GetListLop();
     cboLop.DisplayMember = "TenLop";
     cboLop.ValueMember   = "MaLop";
     cboLop.Text          = "";
 }
コード例 #3
0
 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ố";
 }
コード例 #4
0
ファイル: frmQLChung_Lop.cs プロジェクト: vanhongha/QLNT_OODA
 private void btnFresh_Click(object sender, EventArgs e)
 {
     btnCapNhat.Enabled = false;
     listNienKhoa       = LopBLL.GetListNienKhoa();
     listLoaiLop        = LopBLL.GetListLoaiLop();
     listLop            = LopBLL.GetListLop();
     LoadValueInDGV();
     Init();
 }
コード例 #5
0
ファイル: frmQLChung_Lop.cs プロジェクト: vanhongha/QLNT_OODA
 private void frmQLChung_Lop_Load(object sender, EventArgs e)
 {
     btnCapNhat.Enabled = false;
     listNienKhoa       = LopBLL.GetListNienKhoa();
     listLoaiLop        = LopBLL.GetListLoaiLop();
     listLop            = LopBLL.GetListLop();
     LoadListGiaoVien();
     LoadValueInDGV();
     Init();
 }
コード例 #6
0
        /// <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;
        }
コード例 #7
0
 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() });
     }
 }
コード例 #8
0
ファイル: View_DiemNgoaiKhoa.cs プロジェクト: vanhongha/QLNT
        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          = "";
        }
コード例 #9
0
ファイル: frmQLChung_Lop.cs プロジェクト: vanhongha/QLNT_OODA
 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();
         }
     }
 }
コード例 #10
0
        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);
            }
        }
コード例 #11
0
        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;
        }
コード例 #12
0
        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 = "";
        }
コード例 #13
0
ファイル: frmQLChung_Lop.cs プロジェクト: vanhongha/QLNT_OODA
 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();
     }
 }
コード例 #14
0
 public void getComboboxLop()
 {
     cboLop.DataSource    = LopBLL.GetListLop(LopBLL.getMaNamHoc(dtpNgay_Loc.Value), cboLoaiLop.SelectedValue.ToString().Trim());
     cboLop.DisplayMember = "TenLop";
     cboLop.ValueMember   = "MaLop";
 }