Beispiel #1
0
        //load thong tin khi mo tab
        private void ribbonControl1_SelectedRibbonTabChanged(object sender, EventArgs e)
        {
            String tabName = (sender as RibbonControl).SelectedRibbonTabItem.Name;

            if (tabName.Equals("ribbonTabItemMapGuestToRoom"))
            {
                thongTinDoan = khachHangService.layThongTinDoan(GetIdDoan());
                listRoomUserControl.Clear();
                listKhachHang.Clear();
                listGuestUserControl.Clear();
                availableGuestList.Clear();
                backupGuestList.Clear();
                tinhTrangGiaoDich = (int)thongTinDoan.TinhTrang;
                if (tinhTrangGiaoDich > 1)
                {
                    buttonDatPhong.Text = "Cập nhật";
                    listChiTietGiaoDich = khachHangService.layChiTietGiaoDichTheoMaDoan(idDoan);
                    layDanhSachPhongTrongChiTietGiaoDich();
                }
                idDoan = thongTinDoan.ID;
                LoadThongTinPhongDaChon();
                LoadDanhSachDoan(idDoan);
                TaoGuestUserControl(listKhachHang);
                TaoRoomUserControl();
                if (tinhTrangGiaoDich > 1)
                {
                    LoadThongTinChonPhongTrongChiTietGiaoDich();
                }
            }
            else if (tabName.Equals("ribbonTabChiTiet"))
            {
                this.dataGridViewDetailGiaoDich.Rows.Clear();
                this.dataGridViewDetailGiaoDich.ReadOnly = true;
                RoomService roomservice = new RoomService();
                List <sp_ChiTietGiaoDich_Result> details = roomservice.getChiTietGiaoDich(this.idDoan);
                for (int i = 0; i < details.Count; i++)
                {
                    String[] row = new String[] {
                        details[i].MaDoan,
                        details[i].HoTen,
                        details[i].CMND,
                        details[i].MaPhong,
                        details[i].NgayBatDau,
                        details[i].NgayKetThuc,
                        details[i].DonGia.ToString(),
                        details[i].ThanhTien.ToString()
                    };
                    this.dataGridViewDetailGiaoDich.Rows.Add(row);
                }
            }
        }