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 aToolStripMenuItem_Click(object sender, EventArgs e) { Scenicsfrm frm = new Scenicsfrm(); frm.Powers = this.Powers; frm.ShowDialog(); if (lvTours.SelectedItems.Count > 0) { int _MaTour = MyConvert.ToInt32(lvTours.SelectedItems[0].SubItems[0].Text); lvScenics_Load(DiemDL.FindByMTour(_MaTour)); } }
private void updateToolStripMenuItem_Click(object sender, EventArgs e) { if (lvTours.SelectedItems.Count > 0 && lvScenics.SelectedItems.Count > 0) { int cod = MyConvert.ToInt32(lvScenics.SelectedItems[0].SubItems[0].Text); Scenicfrm frm = new Scenicfrm(); frm.Code = cod; frm.ShowDialog(); if (frm.DialogResult == System.Windows.Forms.DialogResult.OK) { lvScenics_Load(DiemDL.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; } }