public void RefreshDataBinding(int maDatPhong) { //Lấy tất cả tinh trang phong vào cmb listTinhTrangDatPhong = DatPhongBUS.LayTatCaTinhTrangDatPhong_List(); //combobox tinh trang phong txtTinhTrangDat.Properties.Items.Clear(); foreach (TinhTrangDatPhongDTO tinhtrang in listTinhTrangDatPhong) { txtTinhTrangDat.Properties.Items.Add(new MyComboBoxItem(tinhtrang.TinhTrangDatPhong, tinhtrang.MaTinhDatTrangPhong)); } this.datPhong = DatPhongBUS.LayThongTinDatPhong(maDatPhong); txtMaDatPhong.EditValue = maDatPhong; txtTienTraTruoc.EditValue = datPhong.SoTienDatTruoc; txtThoiGian.EditValue = datPhong.ThoiGianDatPhong; txtGhiChu.EditValue = datPhong.GhiChu; dateNgayLapPhieu.DateTime = datPhong.NgayLapPhieuDat; txtTinhTrangDat.EditValue = DatPhongBUS.LayTinhTrangPhong(datPhong.MaTinhTrangDatPhong).TinhTrangDatPhong; khachHang = KhachHangBUS.LayKhachHang(datPhong.MaKH); txtMaKH.EditValue = khachHang.MaKH; txtLoaiKH.EditValue = LoaiKhachHangBUS.LayLoaiKhachHang(khachHang.MaLoaiKH).TenLoaiKH; txtEmail.EditValue = khachHang.Email; txtSDT.EditValue = khachHang.SDT; txtTenKH.EditValue = khachHang.TenKH; txtDiaChi.EditValue = khachHang.DiaChi; txtNgaySinh.EditValue = khachHang.NgaySinh; txtTenNhanVien.EditValue = NhanVienBUS.LayNhanVien(datPhong.MaNhanVien).TenNhanVien; this.TabControl.TabPages.Clear(); foreach (ChiTietDatPhongDTO chiTiet in DatPhongBUS.LayTatCaCacChiTietDatPhong(datPhong.MaDatPhong)) { ThongTinChiTietDatPhong thongTinChiTietDatPhong = new ThongTinChiTietDatPhong(datPhong); thongTinChiTietDatPhong.RefreshDataBinding(chiTiet); DevExpress.XtraTab.XtraTabPage xtraTab = new DevExpress.XtraTab.XtraTabPage(); // // thongTinChiTietPhong1 // thongTinChiTietDatPhong.Appearance.BackColor = System.Drawing.Color.White; thongTinChiTietDatPhong.Appearance.Options.UseBackColor = true; thongTinChiTietDatPhong.Dock = System.Windows.Forms.DockStyle.Fill; thongTinChiTietDatPhong.Location = new System.Drawing.Point(0, 0); thongTinChiTietDatPhong.Name = "thongTinChiTietPhong1"; thongTinChiTietDatPhong.Size = new System.Drawing.Size(989, 591); thongTinChiTietDatPhong.TabIndex = 0; // // tab1 // xtraTab.Controls.Add(thongTinChiTietDatPhong); xtraTab.Name = thongTinChiTietDatPhong.phong.MaPhong.ToString(); xtraTab.Size = new System.Drawing.Size(989, 591); xtraTab.Text = thongTinChiTietDatPhong.phong.TenPhong; xtraTab.Tag = thongTinChiTietDatPhong; // this.TabControl.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { xtraTab }); } if (datPhong.MaTinhTrangDatPhong == 3) { txtTienTraTruoc.ReadOnly = true; txtGhiChu.ReadOnly = true; } }