Example #1
0
        private void frmPhanCongGiangDay_Load(object sender, EventArgs e)
        {
            try
            {
                txtMaPC.Text = PhanCongBUS.SinhMa();

                cmbGiangVien.Properties.DataSource = GiangVienBUS.DanhSachTuyChinh();
                cmbGiangVien.EditValue             = cmbGiangVien.Properties.GetDataSourceValue("MaGV", 0);

                cmbMonHoc.Properties.DataSource = MonHocBUS.DanhSachTuyChinh();
                cmbMonHoc.EditValue             = cmbMonHoc.Properties.GetDataSourceValue("MaMH", 0);

                cmbLop.Properties.DataSource = LopBUS.DanhSachTuyChinh();
                cmbLop.EditValue             = cmbLop.Properties.GetDataSourceValue("MaLop", 0);

                LoadSourceGridControl();
            }
            catch (Exception ex)
            {
                ExceptionUtil.ThrowMsgBox(ex.Message);
            }
        }
 private void Set_cmbGiangVien()
 {
     try
     {
         cmbGiangVien.Properties.DataSource = GiangVienBUS.DanhSachTuyChinh();
         //neu dang nhap bang quyen giang vien
         if (StaticClass.User.Quyen == (int)QuyenNguoiDung.GiangVien)
         {
             xemPhieuGiangDay1.MaGV           = StaticClass.User.TenDangNhap.ToUpper();
             cmbGiangVien.EditValue           = StaticClass.User.TenDangNhap.ToUpper();
             cmbGiangVien.Properties.ReadOnly = true;
         }
         else//dang nhap bang quyen admin
         {
             cmbGiangVien.Properties.ReadOnly = false;
             cmbGiangVien.EditValue           = cmbGiangVien.Properties.GetDataSourceValue("MaGV", 0);
             xemPhieuGiangDay1.MaGV           = cmbGiangVien.EditValue.ToString();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }