private void buttonDDDLTimKiem_Click(object sender, EventArgs e) { //Lấy thông tin tìm kiếm. string QuocGia = ""; string Vung = ""; string ThanhPho = ""; if (this.comboBoxDDDLQuocGia.SelectedIndex != 0) { QuocGia = this.comboBoxDDDLQuocGia.Text; if (this.comboBoxDDDLThanhPho.Enabled == true && this.comboBoxDDDLThanhPho.SelectedIndex > 0) { ThanhPho = this.comboBoxDDDLThanhPho.Text; } if (this.comboBoxDDDLQuocGia.Text.Equals("Việt Nam")) { if (this.comboBoxDDDLVung.Enabled == true && this.comboBoxDDDLVung.SelectedIndex > 0) { Vung = this.comboBoxDDDLVung.Text; } } //Cập nhật lại danh sách, thông tin tìm kiếm isTimKiem = true; ThongTinKiemDDDL = new ThongTinTimKiemDTO(); ThongTinKiemDDDL.ResetData(); ThongTinKiemDDDL.QuocGia = QuocGia; ThongTinKiemDDDL.Vung = Vung; ThongTinKiemDDDL.ThanhPho = ThanhPho; this.DDDL_CurrentPage = 1; DiaDiemDuLichBUS dddlBus = new DiaDiemDuLichBUS(); int n = dddlBus.getTongSeRecordKetQuaTimKiemDDDL(ThongTinKiemDDDL.QuocGia, ThongTinKiemDDDL.Vung, ThongTinKiemDDDL.ThanhPho); this.DDDL_NumberOfPage = (n / DDDL_NumberItemOnAPage); if (n % this.DDDL_NumberItemOnAPage != 0) { this.CB_NumberOfPage++; } CapNhatDanhSachDiaDiemDuLichTheoPhanTrang(1, DDDL_NumberItemOnAPage); } else { MessageBox.Show("Chưa nhập thông tin tìm kiếm."); isTimKiem = false; } }
private void buttonTimKiemKS_Click(object sender, EventArgs e) { //Lấy thông tin tìm kiếm. string TenKS = ""; string TenDDDL = ""; if (this.comboBoxTimKS_TenKS.SelectedIndex != 0) { TenKS = this.comboBoxTimKS_TenKS.Text; if (this.comboBoxTimKS_TenDDDL.Enabled == true && this.comboBoxTimKS_TenDDDL.SelectedIndex > 0) { TenDDDL = this.comboBoxTimKS_TenDDDL.Text; } //Cập nhật lại danh sách, thông tin tìm kiếm isTimKiem = true; ThongTinKiemKS = new ThongTinTimKiemDTO(); ThongTinKiemKS.ResetDataTKKhachSan(); ThongTinKiemKS.TenKS = TenKS; ThongTinKiemDDDL.TenDDDL = TenDDDL; this.KS_CurrentPage = 1; KhachSanBUS ksBus = new KhachSanBUS(); int n = ksBus.getTongSeRecordKetQuaTimKiemKhachSan(ThongTinKiemKS.TenKS, ThongTinKiemKS.TenDDDL); this.KS_NumberOfPage = (n / KS_NumberItemOnAPage); if (n % this.KS_NumberItemOnAPage != 0) { this.KS_NumberOfPage++; } CapNhatDanhSachKhachSanTheoPhanTrang(1, KS_NumberItemOnAPage); } else { MessageBox.Show("Chưa nhập thông tin tìm kiếm."); isTimKiem = false; } }