Example #1
0
 private void FormLoaiNha_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") && !Chung.LayDSQuyenHan(Chung.loaiNhanVien)[i].Equals("Chỉnh sửa - nhân viên quảng cáo"))
         {
             break;
         }
         if (i == Chung.LayDSQuyenHan(Chung.loaiNhanVien).Count - 1)
         {
             AnButton();
         }
     }
     LamMoiThongTin();
     dgvLoaiNha.DataSource = loaiNhaBLL.LayDanhSachLoaiNha();
 }
Example #2
0
        private void FormDiaOc_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 (MaKhachHangPoup == 0)
            {
                txtMaKhachHang.Visible = false;
                dgvDiaOc.DataSource    = diaOcBLL.LayDanhSachDiaOcTheoTenLoai();
            }
            else
            {
                cbKhachHang.Visible      = false;
                btnThemKhachHang.Visible = false;
                txtMaKhachHang.Text      = MaKhachHangPoup.ToString();
                dgvDiaOc.DataSource      = diaOcBLL.LayDanhSachDiaOcTheoMaKH(MaKhachHangPoup);
                txtCMND.Text             = khachHangBLL.LayDanhSachKhachHangTheoMa(MaKhachHangPoup).Rows[0]["CMND"].ToString();
            }

            cbKhachHang.DataSource    = khachHangBLL.LayDanhSachKhachHang();
            cbKhachHang.DisplayMember = "TenKhachHang";
            cbKhachHang.ValueMember   = "MaKhachHang";
            cbLoaiDiaOc.DataSource    = loaiDiaOcBLL.LayDanhSachLoaiDiaOc();
            cbLoaiDiaOc.DisplayMember = "TenLoaiDiaOc";
            cbLoaiDiaOc.ValueMember   = "MaLoaiDiaOc";
            cbLoaiNha.DataSource      = loaiNhaBLL.LayDanhSachLoaiNha();
            cbLoaiNha.DisplayMember   = "TenLoaiNha";
            cbLoaiNha.ValueMember     = "MaLoaiNha";
            LamMoiThongTin();
            checkLoadDone = true;
        }