private void buttonDDDLChuyenBay_Click(object sender, EventArgs e) { //Chuẩn bị dữ liệu cho form bình luận int index = this.dataGridViewDSDiaDiemDuLich.CurrentRow.Index; if (index >= 0) { DiaDiemDuLichBUS DiaDiemDuLichBUS = new DiaDiemDuLichBUS(); int MaDDDL = this.DDDL_DsDiaDiemDuLich[index].MaDDDL; this.labelTenDDDL_CB.Text = this.DDDL_DsDiaDiemDuLich[index].TenDDDL; List <ChuyenBayDTO> dsCB = DiaDiemDuLichBUS.getDanhSachChuyenBay(MaDDDL); BindingSource bindData = new BindingSource(); bindData.DataSource = dsCB; this.dataGridViewXemChuyenBay.DataSource = bindData; this.dataGridViewXemChuyenBay.Refresh(); this.dataGridViewXemChuyenBay.Parent.Parent.Refresh(); this.dataGridViewXemChuyenBay.Columns["DiaDiemDi"].Visible = false; this.dataGridViewXemChuyenBay.Columns["DiaDiemDen"].Visible = false; this.TabControlUser.SelectTab(tabPageXemChuyenBay); } else { MessageBox.Show("Chưa dọn địa điểm du lịch !"); } }
private void buttonDDDlXemBinhLuan_Click(object sender, EventArgs e) { //Chuẩn bị dữ liệu cho form bình luận int index = this.dataGridViewDSDiaDiemDuLich.CurrentRow.Index; if (index >= 0) { DiaDiemDuLichBUS DiaDiemDuLichBUS = new DiaDiemDuLichBUS(); int MaDDDL = this.DDDL_DsDiaDiemDuLich[index].MaDDDL; this.labelTenDiaDiemDuLich.Text = this.DDDL_DsDiaDiemDuLich[index].TenDDDL; List <BinhLuanDTO> dsBinhLuan = DiaDiemDuLichBUS.getDanhSachBinhLuan(MaDDDL); BindingSource bindData = new BindingSource(); bindData.DataSource = dsBinhLuan; this.dataGridViewXemBinhLuan.DataSource = bindData; this.dataGridViewXemBinhLuan.Refresh(); this.dataGridViewXemBinhLuan.Parent.Parent.Refresh(); this.dataGridViewXemBinhLuan.Columns["MaBinhLuan"].Width = 100; this.dataGridViewXemBinhLuan.Columns["NoiDung"].Width = 500; this.dataGridViewXemBinhLuan.Columns["MaDDDL"].Visible = false; this.dataGridViewXemBinhLuan.Columns["Valid"].Visible = false; this.TabControlUser.SelectTab(tabPageXemBinhLuan); } else { MessageBox.Show("Chưa dọn địa điểm du lịch !"); } }
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; } }
// ---------------- Dia Diem Du Lich------------------------------------ public void MyInitial() { DiaDiemDuLichBUS dddlBus = new DiaDiemDuLichBUS(); //Đếm số lượng record trong bảng du lịch. int nR = dddlBus.getTongSoRecord(); DDDL_NumberOfPage = nR / DDDL_NumberItemOnAPage; if (nR % DDDL_NumberItemOnAPage != 0) { DDDL_NumberOfPage++; } //Lấy danh sách trang đầu tiên. CapNhatDanhSachDiaDiemDuLichTheoPhanTrang(1, DDDL_NumberItemOnAPage); //Lấy danh sách tên quốc gia, vùng LoadQuocGia(); LoadVung(); }
private void CapNhatDanhSachDiaDiemDuLichTheoPhanTrang(int iPage, int nItem) { DiaDiemDuLichBUS dddlBus = new DiaDiemDuLichBUS(); if (!isTimKiem) { DDDL_DsDiaDiemDuLich = dddlBus.getDanhSachDiaDiemDuLich(iPage, DDDL_NumberItemOnAPage); } else { DDDL_DsDiaDiemDuLich = dddlBus.TimKiemDiaDiemDuLich(ThongTinKiemDDDL.QuocGia, ThongTinKiemDDDL.Vung, ThongTinKiemDDDL.ThanhPho, iPage, nItem); } BindingSource bindData = new BindingSource(); bindData.DataSource = DDDL_DsDiaDiemDuLich; this.labelDsDDDLPhanTrang.Text = this.DDDL_CurrentPage.ToString() + "/" + this.DDDL_NumberOfPage.ToString(); this.dataGridViewDSDiaDiemDuLich.DataSource = bindData; this.dataGridViewDSDiaDiemDuLich.Refresh(); this.dataGridViewDSDiaDiemDuLich.Parent.Parent.Refresh(); this.dataGridViewDSDiaDiemDuLich.Columns["HinhAnh"].Visible = false; this.dataGridViewDSDiaDiemDuLich.Columns["MoTa"].Visible = false; }
private void buttonDDDLKhachSan_Click(object sender, EventArgs e) { int index = this.dataGridViewDSDiaDiemDuLich.CurrentRow.Index; if (index >= 0) { DiaDiemDuLichBUS DiaDiemDuLichBUS = new DiaDiemDuLichBUS(); int MaDDDL = this.DDDL_DsDiaDiemDuLich[index].MaDDDL; this.labelTenDDDL_Tour.Text = this.DDDL_DsDiaDiemDuLich[index].TenDDDL; List <KhachSanDTO> dsKS = DiaDiemDuLichBUS.getDanhSachKhachSan1(MaDDDL); BindingSource bindData = new BindingSource(); bindData.DataSource = dsKS; this.dataGridViewXemKhachSan.DataSource = bindData; this.dataGridViewXemKhachSan.Refresh(); this.dataGridViewXemKhachSan.Parent.Parent.Refresh(); this.dataGridViewXemKhachSan.Columns["MaDDDL"].Visible = false; this.TabControlUser.SelectTab(tabPageXemKhachSan); } else { MessageBox.Show("Chưa dọn địa điểm du lịch !"); } }