Example #1
0
 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;
     }
 }