//Hiennv
 public List<BookingHEN> LoadData()
 {
     try
     {
         BookingHsBO aBookingHsBO = new BookingHsBO();
         List<BookingHEN> aListBookedHs = new List<BookingHEN>();
         List<BookingHs> aListTemp = new List<BookingHs>();
         aListTemp = aBookingHsBO.Select_ByDate_byStatus(dtpFrom.DateTime, dtpTo.DateTime);
         BookingHEN aBookingHEN;
         for (int i = 0; i < aListTemp.Count; i++)
         {
             aBookingHEN = new BookingHEN();
             aBookingHEN.SetValue(aListTemp[i]);
             aBookingHEN.StatusPayDisplay = CORE.CONSTANTS.SelectedStatusPay(Convert.ToInt16(aBookingHEN.StatusPay)).Name;
             aBookingHEN.CustomerTypeDisplay = CORE.CONSTANTS.SelectedCustomerType(Convert.ToInt16(aBookingHEN.CustomerType)).Name;
             if (aBookingHEN.Type == 1)
             {
                 aBookingHEN.TypeDisplay = "Tiệc không thuộc phạm trù nhà bếp";
             }
             else
             {
                 aBookingHEN.TypeDisplay = "Tiệc thuộc phạm trù nhà bếp";
             }
             aListBookedHs.Add(aBookingHEN);
         }
         return aListBookedHs;
     }
     catch (Exception ex)
     {
         return null;
         MessageBox.Show("frmTsk_ListBookingHs.LoadData\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public void ReloadData()
 {
     try
     {
         BookingHsBO aBookingHsBO = new BookingHsBO();
         List<BookingHEN> aListBookedHs = new List<BookingHEN>();
         List<BookingHs> aListTemp = new List<BookingHs>();
         int Status = Convert.ToInt32(lueStatus.EditValue);
         aListTemp = aBookingHsBO.SelectBookingHs_ByTime_ByStatus(dtpFrom.DateTime, dtpTo.DateTime, Status);
         BookingHEN aBookingHEN;
         for (int i = 0; i < aListTemp.Count; i++)
         {
             aBookingHEN = new BookingHEN();
             aBookingHEN.SetValue(aListTemp[i]);
             aBookingHEN.StatusPayDisplay = CORE.CONSTANTS.SelectedStatusPay(Convert.ToInt16(aBookingHEN.StatusPay)).Name;
             aBookingHEN.CustomerTypeDisplay = CORE.CONSTANTS.SelectedCustomerType(Convert.ToInt16(aBookingHEN.CustomerType)).Name;
             if (aBookingHEN.Type == 1)
             {
                 aBookingHEN.TypeDisplay = "Tiệc không thuộc phạm trù nhà bếp";
             }
             else
             {
                 aBookingHEN.TypeDisplay = "Tiệc thuộc phạm trù nhà bếp";
             }
             aListBookedHs.Add(aBookingHEN);
         }
         dgvBookingHs.DataSource = aListBookedHs;
         dgvBookingHs.RefreshDataSource();
         if (Status == 1)
         {
             gridColumn7.Visible = true;
             gridColumn8.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
         else if (Status == 2)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = true;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
         else if (Status == 3)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn12.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
         else if (Status == 4)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn14.Visible = true;
             gridColumn15.Visible = false;
         }
         else if (Status == 5)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = true;
         }
         else if (Status == 6)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = true;
             gridColumn11.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
         else if (Status == 7)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = true;
             gridColumn12.Visible = false;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
         else if (Status == 8)
         {
             gridColumn7.Visible = false;
             gridColumn8.Visible = false;
             gridColumn9.Visible = false;
             gridColumn10.Visible = false;
             gridColumn11.Visible = false;
             gridColumn12.Visible = true;
             gridColumn14.Visible = false;
             gridColumn15.Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_ManageBookingHs.ReloadData \n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void frmTsk_ListBookingHs_Load(object sender, EventArgs e)
        {
            dtpFrom.DateTime = DateTime.Now.Date;
            dtpTo.DateTime = DateTime.Now.AddDays(7);
            dgvBookingRs.DataSource = this.LoadData();
            dgvBookingRs.RefreshDataSource();

            if (afrmTsk_ManageBookingHs != null)
            {
                tableLayoutPanel3.Visible = false;
                BookingHsBO aBookingHsBO = new BookingHsBO();
                List<BookingHEN> aListBookedHs = new List<BookingHEN>();
                BookingHs aTemp = aBookingHsBO.Select_ByID(this.IDBookingH);
                List<BookingHs> aListTemp = new List<BookingHs>();
                aListTemp.Add(aTemp);
                BookingHEN aBookingHEN;
                for (int i = 0; i < aListTemp.Count; i++)
                {
                    aBookingHEN = new BookingHEN();
                    aBookingHEN.SetValue(aListTemp[i]);
                    aBookingHEN.StatusPayDisplay = CORE.CONSTANTS.SelectedStatusPay(Convert.ToInt16(aBookingHEN.StatusPay)).Name;
                    aBookingHEN.CustomerTypeDisplay = CORE.CONSTANTS.SelectedCustomerType(Convert.ToInt16(aBookingHEN.CustomerType)).Name;
                    if (aBookingHEN.Type == 1)
                    {
                        aBookingHEN.TypeDisplay = "Tiệc không thuộc phạm trù nhà bếp";
                    }
                    else
                    {
                        aBookingHEN.TypeDisplay = "Tiệc thuộc phạm trù nhà bếp";
                    }
                    aListBookedHs.Add(aBookingHEN);
                }
                dgvBookingRs.DataSource = aListBookedHs;
                dgvBookingRs.RefreshDataSource();
            }
        }
 private List<BookingHEN> LoadData(int Status)
 {
     BookingHsBO aBookingHsBO = new BookingHsBO();
         List<BookingHEN> aListBookedHs = new List<BookingHEN>();
         List<BookingHs> aListTemp = new List<BookingHs>();
         aListTemp = aBookingHsBO.SelectBookingHs_ByTime_ByStatus(dtpFrom.DateTime, dtpTo.DateTime, Status);
         BookingHEN aBookingHEN;
         for (int i = 0; i < aListTemp.Count; i++)
         {
             aBookingHEN = new BookingHEN();
             aBookingHEN.SetValue(aListTemp[i]);
             aBookingHEN.StatusPayDisplay = CORE.CONSTANTS.SelectedStatusPay(Convert.ToInt16(aBookingHEN.StatusPay)).Name;
             aBookingHEN.CustomerTypeDisplay = CORE.CONSTANTS.SelectedCustomerType(Convert.ToInt16(aBookingHEN.CustomerType)).Name;
             aBookingHEN.StatusDisplay = CORE.CONSTANTS.SelectedBookingHStatus(Convert.ToInt16(aBookingHEN.Status)).Name;
             if (aBookingHEN.Type == 1)
             {
                 aBookingHEN.TypeDisplay = "Tiệc không thuộc phạm trù nhà bếp";
             }
             else
             {
                 aBookingHEN.TypeDisplay = "Tiệc thuộc phạm trù nhà bếp";
             }
             aListBookedHs.Add(aBookingHEN);
         }
         return aListBookedHs;
 }