示例#1
0
 private void FormHinhAnh_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < Chung.LayDSQuyenHan(Chung.loaiNhanVien).Count; i++)
     {
         if (Chung.LayDSQuyenHan(Chung.loaiNhanVien)[i].Contains("Chỉnh sửa"))
         {
             break;
         }
         if (i == Chung.LayDSQuyenHan(Chung.loaiNhanVien).Count - 1)
         {
             AnButton();
         }
     }
     if (MaPDKTuFormPDK == 0 && MaDiaOc == 0)
     {
         txtMaPhieuDangKy.Visible = false;
         dgvHinhAnh.DataSource    = hinhAnhBLL.LayDanhSachHinhAnh();
     }
     else if (MaDiaOc > 0 && MaPDKTuFormPDK == 0)
     {
         txtMaPhieuDangKy.Visible = false;
         dgvHinhAnh.DataSource    = diaOcBLL.LayDanhSachHinhAnh(MaDiaOc);
     }
     else if (MaDiaOc == 0 && MaPDKTuFormPDK > 0)
     {
         cbMaPDK.Visible       = false;
         txtMaPhieuDangKy.Text = MaPDKTuFormPDK.ToString();
         btnThemPDK.Visible    = false;
         dgvHinhAnh.DataSource = hinhAnhBLL.LayDanhSachTheoMaPDK(MaPDKTuFormPDK);
     }
     if (MaDiaOc == 0)
     {
         cbMaPDK.DataSource = phieuDangKyBLL.LayDanhSachPhieuDangKy();
     }
     else
     {
         cbMaPDK.DataSource = diaOcBLL.LayDanhSachHinhAnh(MaDiaOc);
     }
     cbMaPDK.DisplayMember = "MaPhieuDangKy";
     cbMaPDK.ValueMember   = "MaPhieuDangKy";
     cbMaNV.DataSource     = nhanVienBLL.LayDanhSachNhanVien();
     cbMaNV.DisplayMember  = "MaNhanVien";
     cbMaNV.ValueMember    = "MaNhanVien";
 }
示例#2
0
 private void FormChiTietHinhAnh_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < Chung.LayDSQuyenHan(Chung.loaiNhanVien).Count; i++)
     {
         if (Chung.LayDSQuyenHan(Chung.loaiNhanVien)[i].Contains("Chỉnh sửa"))
         {
             break;
         }
         if (i == Chung.LayDSQuyenHan(Chung.loaiNhanVien).Count - 1)
         {
             AnButton();
         }
     }
     if (!kt)
     {
         dgvChiTietHinhAnh.DataSource = chiTietHinhAnhBLL.LayDanhSachChiTietHinhAnh();
         cbMaHA.DataSource            = hinhAnhBLL.LayDanhSachHinhAnh();
         cbMaHA.DisplayMember         = "MaHinhAnh";
         cbMaHA.ValueMember           = "MaHinhAnh";
     }
 }