public void ReloadData()
        {
            try
            {
                dgvAvailableCompanies.DataSource = null;

                List<Companies> aListCompanies = new List<Companies>();
                CompaniesBO aCompaniesBO = new CompaniesBO();
                if (afrmIns_CustomerGroups_Customers_Old != null)
                {
                    aListCompanies = aCompaniesBO.Select_All();
                    btnAdd.Visible = false;
                }
                else if(this.afrmTsk_BookingHall_Goverment != null)
                {
                    aListCompanies = aCompaniesBO.Select_ByType(Type);
                    btnAdd.Visible = false;
                }
                else if (this.afrmTsk_BookingHall_Group != null)
                {
                    aListCompanies = aCompaniesBO.Select_ByType(Type);
                    btnAdd.Visible = false;
                }
                else if (this.afrmTsk_UpdBooking != null)
                {
                    aListCompanies = aCompaniesBO.Select_ByType(Type);
                    btnAdd.Visible = false;
                }
                else
                {
                    aListCompanies = aCompaniesBO.Select_All();
                    btnAdd.Visible = true;
                }
                dgvAvailableCompanies.DataSource = aListCompanies;
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmLst_Companies.ReloadData\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 //Load IDCompanies
 public void LoadIDCompanies()
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         lueIDCompanies.Properties.DataSource = aCompaniesBO.Select_ByType(2);// [Company] Type = 2 : Công ty ngoài, 2;
         lueIDCompanies.Properties.DisplayMember = "Name";
         lueIDCompanies.Properties.ValueMember = "ID";
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_CheckIn_Group_Step2.LoadIDCompanies\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //Load IDCompany
 public void LoadIDCompanies()
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         List<Companies> aListCompanies = aCompaniesBO.Select_ByType(1);// [Company] Type = 1 : Nha nuoc, 1;
         lueIDCompanies.Properties.DataSource = aListCompanies;
         lueIDCompanies.Properties.DisplayMember = "Name";
         lueIDCompanies.Properties.ValueMember = "ID";
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_CheckIn_Goverment_Step2.LoadIDCompanies\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public void LoadCompany()
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         List<Companies> aListCompanies = aCompaniesBO.Select_ByType(3);// [Company] Type = 3;
         lueIDCompany.Properties.DataSource = aListCompanies;
         lueIDCompany.Properties.DisplayMember = "Name";
         lueIDCompany.Properties.ValueMember = "ID";
         if(aListCompanies.Count > 0)
         {
             lueIDCompany.EditValue = aListCompanies[0].ID;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmAddNewBookingRs_Goverment.LoadCompany\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //hiennv
 public void LoadCompany()
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         List<Companies> aListCompanies = aCompaniesBO.Select_ByType(3);// [Company] Type = 3;
         lueIDCompany.Properties.DataSource = aListCompanies;
         lueIDCompany.Properties.DisplayMember = "Name";
         lueIDCompany.Properties.ValueMember = "ID";
         if (aListCompanies.Count > 0)
         {
             lueIDCompany.EditValue = this.aCheckInRoomBookingEN.IDCompany;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_CheckInCustomer_ForRoomBooking_Step2.LoadCompany\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public void LoadCompanies()
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         lueCompany.Properties.DataSource = aCompaniesBO.Select_ByType(1);// [Company] Type = 1 : Nha nuoc, 1;
         lueCompany.Properties.DisplayMember = "Name";
         lueCompany.Properties.ValueMember = "ID";
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_UpdBooking.LoadCompanies\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 //Hiennv    tạo mới      18/11/2014   Load ra toàn bộ danh sách công ty theo loại công ty (Nhà nước, đoàn ,lẻ)
 private List<Companies> LoadListCompaniesByType(int type)
 {
     try
     {
         CompaniesBO aCompaniesBO = new CompaniesBO();
         return aCompaniesBO.Select_ByType(type);
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_CheckIn.LoadListCompaniesByType()\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
 }
        //Load IDCompany
        public void LoadIDCompanies(int Type)
        {
            try
            {
                CompaniesBO aCompaniesBO = new CompaniesBO();
                List<Companies> aListCompanies = aCompaniesBO.Select_ByType(Type);
                lueIDCompanies.Properties.DataSource = aListCompanies;
                lueIDCompanies.Properties.DisplayMember = "Name";
                lueIDCompanies.Properties.ValueMember = "ID";
                if (Type == 3)
                {
                    if (aListCompanies.Count > 0)
                    {
                        lueIDCompanies.EditValue = aListCompanies[0].ID;
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("frmTsk_Booking_Step2.LoadIDCompanies\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }