private void lvTrips_SelectedIndexChanged(object sender, EventArgs e) { if (lvTrips.SelectedItems.Count > 0) { int _Machuyen = MyConvert.ToInt32(lvTrips.SelectedItems[0].SubItems[0].Text); int _MaTour = 0; foreach (Chuyen item in listTrip) { if (item.MChuyen == _Machuyen) { _MaTour = item.MTour; break; } } lvScenics_Load(DiemDL.FindByMTour(_MaTour)); lvGuide_Load(HuongDanVien.FindByMChuyen(_Machuyen)); lvHotels_Load(KhachSan.FindByMTour(_MaTour)); lvVehicles_Load(PhuongTien.FindByMTour(_MaTour)); lvCustomers_Load(KhachHang.FindByMChuyen(_Machuyen)); btnUpdate.Enabled = true; btnDelete.Enabled = true; } else { lvGuide.Items.Clear(); lvHotels.Items.Clear(); lvScenics.Items.Clear(); lvCustomers.Items.Clear(); btnUpdate.Enabled = false; btnDelete.Enabled = false; } }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { Hotelsfrm frm = new Hotelsfrm(); frm.Powers = this.Powers; frm.ShowDialog(); if (lvTours.SelectedItems.Count > 0) { int _MaTour = MyConvert.ToInt32(lvTours.SelectedItems[0].SubItems[0].Text); lvHotels_Load(KhachSan.FindByMTour(_MaTour)); } }
private void toolStripMenuItem3_Click(object sender, EventArgs e) { if (lvTours.SelectedItems.Count > 0 && lvHotels.SelectedItems.Count > 0) { int cod = MyConvert.ToInt32(lvHotels.SelectedItems[0].SubItems[0].Text); Hotelfrm frm = new Hotelfrm(); frm.Code = cod; frm.ShowDialog(); if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { lvHotels_Load(KhachSan.FindByMTour(MyConvert.ToInt32(lvTours.SelectedItems[0].SubItems[0].Text))); } } }
private void lvTours_SelectedIndexChanged(object sender, EventArgs e) { if (lvTours.SelectedItems.Count > 0) { int _MaTour = MyConvert.ToInt32(lvTours.SelectedItems[0].SubItems[0].Text); lvScenics_Load(DiemDL.FindByMTour(_MaTour)); lvHotels_Load(KhachSan.FindByMTour(_MaTour)); lvVehicles_Load(PhuongTien.FindByMTour(_MaTour)); lvGuide_Load(HuongDanVien.FindByMTour(_MaTour)); btnUpdate.Enabled = true; btnDelete.Enabled = true; } else { lvGuide.Items.Clear(); lvHotels.Items.Clear(); lvScenics.Items.Clear(); lvVehicles.Items.Clear(); btnUpdate.Enabled = false; btnDelete.Enabled = false; } }