public List<BookingHEN> Reload()
        {
            try
            {
                if (this.ValidateData() == true)
                {
                    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, 7);

                    BookingHEN aBookingHEN;
                    for (int i = 0; i < aListTemp.Count; i++)
                    {
                        aBookingHEN = new BookingHEN();
                        aBookingHEN.SetValue(aListTemp[i]);
                        aBookingHEN.StatusDisplay = CORE.CONSTANTS.SelectedBookingHStatus(Convert.ToInt16(aBookingHEN.Status)).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;
                }
                return null;
            }
            catch (Exception ex)
            {
                return null;
                MessageBox.Show("frmTsk_UnpayBookingHs.Reload\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);
     }
 }
Пример #3
0
 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;
 }