//hiennv public bool LoadDataBookingHalls() { try { if (dtpFrom.DateTime.Date > dtpTo.DateTime.Date) { dtpFrom.Focus(); MessageBox.Show("Vui lòng nhập ngày bắt đầu tìm kiếm phải nhỏ hơn hoặc bằng ngày kết thúc tìm kiếm.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; } else { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); BookingHallsBO aBookingHallsBO = new BookingHallsBO(); List<BookingHallsEN> aListTemp = new List<BookingHallsEN>(); List<BookingHallsEN> aListBookingHallsEN = new List<BookingHallsEN>(); int choose = cboChoose.SelectedIndex; int level = Convert.ToInt32(lueBookingHs_Level.EditValue); if (choose == 0) // Tất cả hội trường { colDetail.Visible = true; colCreateMenu.Visible = false; colNameGuest.Visible = false; gridColumn1.Visible = false; aListTemp = aReceptionTaskBO.GetListBookingHallsIsUse_ByBookingHallsDate(dtpFrom.DateTime.Date, dtpTo.DateTime.Date); } else if (choose == 1) // Tiệc VIP { colDetail.Visible = true; colCreateMenu.Visible = false; colNameGuest.Visible = false; gridColumn1.Visible = false; aListTemp = aReceptionTaskBO.GetListBookingHalls_ByBookingHallsDate_ByBookingHsLevel(dtpFrom.DateTime, dtpTo.DateTime, level); } else if (choose == 2) // Tiệc chưa accept { colDetail.Visible = true; colCreateMenu.Visible = true; colNameGuest.Visible = false; gridColumn1.Visible = false; aListTemp = aReceptionTaskBO.GetListBookingHalls_ByBookingHallDate_ByBookingHallStatus(dtpFrom.DateTime, dtpTo.DateTime, 1); // bep chua accept } //else if (choose == 3) // Tiệc đã accept nhưng chưa có thực đơn //{ // colDetail.Visible = true; // colCreateMenu.Visible = true; // colNameGuest.Visible = false; // gridColumn1.Visible = false; // aListTemp = aReceptionTaskBO.GetListBookingHallsAcceptedButHaveNotMenus(dtpFrom.DateTime, dtpTo.DateTime); // bep da accept //} else if (choose == 4)// Bếp đã lên thực đơn { colDetail.Visible = true; colCreateMenu.Visible = false; colNameGuest.Visible = false; gridColumn1.Visible = true; aListTemp = aReceptionTaskBO.GetListBookingHallsHaveMenus(dtpFrom.DateTime, dtpTo.DateTime); } else if (choose == 5) //Đã lựa chọn thực đơn { colDetail.Visible = true; colCreateMenu.Visible = false; colNameGuest.Visible = false; gridColumn1.Visible = false; aListTemp = aReceptionTaskBO.GetListBookingHallsSelectedMenus(dtpFrom.DateTime, dtpTo.DateTime); } else if (choose == 6) // tim kiem tiec theo khach moi { colDetail.Visible = true; colCreateMenu.Visible = false; colNameGuest.VisibleIndex = 1; colNameGuest.Visible = true; gridColumn1.Visible = false; aListTemp = aReceptionTaskBO.GetListBookingHalls_ByBookingHallsDate_ByNameGuest(dtpFrom.DateTime, dtpTo.DateTime,txtNameGuest.Text); } BookingHallsEN aBookingHallsEN; foreach (BookingHallsEN item in aListTemp) { aBookingHallsEN = new BookingHallsEN(); aBookingHallsEN.IDBookingH = item.IDBookingH; aBookingHallsEN.DisplayCustomerType = CORE.CONSTANTS.SelectedCustomerType(Convert.ToInt32(item.CustomerTypeBookingH)).Name; aBookingHallsEN.IDBookingHall = item.IDBookingHall; aBookingHallsEN.BookingStatusBookingHall = item.BookingStatusBookingHall; aBookingHallsEN.NameCustomer = item.NameCustomer; aBookingHallsEN.NameCustomerGroup = item.NameCustomerGroup; aBookingHallsEN.DateBookingHall = item.DateBookingHall; aBookingHallsEN.LunarDateBookingHall = item.LunarDateBookingHall; aBookingHallsEN.StartTimeBookingHall = item.StartTimeBookingHall; aBookingHallsEN.EndTimeBookingHall = item.EndTimeBookingHall; aBookingHallsEN.BookingTypeBookingH = item.BookingTypeBookingH; aBookingHallsEN.StatusPayBookingH = item.StatusPayBookingH; aBookingHallsEN.NoteBookingH = item.NoteBookingH; aBookingHallsEN.DisplayBookingType = CORE.CONSTANTS.SelectedBookingType(Convert.ToInt32(item.BookingTypeBookingH)).Name; aBookingHallsEN.DisplayLevel = CORE.CONSTANTS.SelectedLevel(Convert.ToInt32(item.LevelBookingH)).Name; aBookingHallsEN.SkuHall = item.SkuHall; aBookingHallsEN.NameGuest = item.NameGuest; aListBookingHallsEN.Add(aBookingHallsEN); } dgvBookingHalls.DataSource = aListBookingHallsEN; dgvBookingHalls.RefreshDataSource(); if (aListBookingHallsEN.Count > 0) { return true; } else { return false; } } } catch (Exception ex) { MessageBox.Show("frmTsk_SearchBookingHalls.LoadDataBookingHalls\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return true; } }