public void Reload()
 {
     try
     {
         GuestsBO aGuestsBO = new GuestsBO();
         dgvGuest.DataSource = aGuestsBO.Select_All();
         dgvGuest.RefreshDataSource();
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmLst_Guests.Reload\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public void CallBackGuest(int IDGuest)
 {
     try
     {
         GuestsBO aGuestsBO = new GuestsBO();
         lueGuest.Properties.DataSource = aGuestsBO.Select_All();
         lueGuest.Properties.DisplayMember = "Name";
         lueGuest.Properties.ValueMember = "ID";
         lueGuest.EditValue = IDGuest;
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_BookingHall_Customer_New.CallBackGuest\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public void LoadGuest()
        {
            try
            {
                GuestsBO aGuestsBO = new GuestsBO();
                lueGuest.Properties.DataSource = aGuestsBO.Select_All();
                lueGuest.Properties.DisplayMember = "Name";
                lueGuest.Properties.ValueMember = "ID";
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmTsk_BookingHall_Customer_New.LoadService\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
        }
        public void LoadData()
        {
            //Load dữ liệu công ty
            if (this.CustomerType == 1)
            {
                this.Text = "Đặt tiệc cho khách nhà nước";
                Companies aDefault = new Companies();
                List<Companies> aList = new List<Companies>();
                aDefault.Name = "[Tạo mới cty]";
                aDefault.ID = 0;

                aList = aCompaniesBO.Select_ByType(1);// [Company] Type = 1 : khách nhà nước
                aList.Add(aDefault);
                lueCompany.Properties.DataSource = aList;
                lueCompany.Properties.DisplayMember = "Name";
                lueCompany.Properties.ValueMember = "ID";

                if (this.IDCompany > 0)
                {
                    lueCompany.EditValue = this.IDCompany;
                }
                else
                {
                    lueCompany.EditValue = 0;
                }
            }
            if (this.CustomerType == 2)
            {
                this.Text = "Đặt tiệc cho khách đoàn";

                Companies aDefault = new Companies();
                List<Companies> aList = new List<Companies>();
                aDefault.Name = "[Tạo mới cty]";
                aDefault.ID = 0;

                aList = aCompaniesBO.Select_ByType(2);// [Company] Type = 2 : khách đoàn
                aList.Add(aDefault);
                lueCompany.Properties.DataSource = aList;
                lueCompany.Properties.DisplayMember = "Name";
                lueCompany.Properties.ValueMember = "ID";

                if (this.IDCompany > 0)
                {
                    lueCompany.EditValue = this.IDCompany;
                }
                else
                {
                    lueCompany.EditValue = 0;
                }
            }
            if (this.CustomerType == 3)
            {
                this.Text = "Đặt tiệc cho khách lẻ";

                Companies aDefault = new Companies();
                List<Companies> aList = new List<Companies>();
                aDefault.Name = "[Tạo mới cty]";
                aDefault.ID = 0;

                aList = aCompaniesBO.Select_ByType(3);// [Company] Type = 3 : khách lẻ
                aList.Add(aDefault);
                lueCompany.Properties.DataSource = aList;
                lueCompany.Properties.DisplayMember = "Name";
                lueCompany.Properties.ValueMember = "ID";
                if (this.IDCompany > 0)
                {
                    lueCompany.EditValue = this.IDCompany;
                }
                else
                {
                    lueCompany.EditValue = 0;
                }
            }
            //Load dữ liệu khách
            lueCustomer.Properties.DataSource = aCustomersBO.Select_All();
            lueCustomer.Properties.DisplayMember = "Name";
            lueCustomer.Properties.ValueMember = "ID";
            if (this.IDCustomer > 0)
            {
                lueCustomer.EditValue = this.IDCustomer;

            }
            else
            {
                lueCustomer.EditValue = 0;
            }

            // Load khách mời
            GuestsBO aGuestsBO = new GuestsBO();
            lueGuest.Properties.DataSource = aGuestsBO.Select_All();
            lueGuest.Properties.DisplayMember = "Name";
            lueGuest.Properties.ValueMember = "ID";
            LoadDataListFoods();
        }