public void LoadServiceInBookingHall(int IDBookHall)
        {
            try
            {
                ServicesBO aServicesBO = new ServicesBO();
                BookingHalls_ServicesBO aBookingHalls_ServicesBO = new BookingHalls_ServicesBO();
                List<BookingHalls_Services> aListTemp = aBookingHalls_ServicesBO.Select_ByIDBookingHall(IDBookHall);
                BookingHall_ServiceEN aBookingHall_ServiceEN;
                for (int i = 0; i < aListTemp.Count; i++)
                {
                    aBookingHall_ServiceEN = new BookingHall_ServiceEN();
                    aBookingHall_ServiceEN.ID = aListTemp[i].ID;
                    aBookingHall_ServiceEN.Info = aListTemp[i].Info;
                    aBookingHall_ServiceEN.Type = aListTemp[i].Type;
                    aBookingHall_ServiceEN.Status = aListTemp[i].Status;
                    aBookingHall_ServiceEN.Disable = aListTemp[i].Disable;
                    aBookingHall_ServiceEN.IDBookingHall = aListTemp[i].IDBookingHall;
                    aBookingHall_ServiceEN.IDService = aListTemp[i].IDService;
                    aBookingHall_ServiceEN.Service_Name = aServicesBO.Select_ByID(aListTemp[i].IDService).Name;
                    aBookingHall_ServiceEN.Service_Unit = aServicesBO.Select_ByID(aListTemp[i].IDService).Unit;
                    aBookingHall_ServiceEN.Cost = aListTemp[i].Cost == null ? aListTemp[i].CostRef_Services : aListTemp[i].Cost;
                    aBookingHall_ServiceEN.CostRef_Services = aListTemp[i].CostRef_Services;
                    aBookingHall_ServiceEN.Date = aListTemp[i].Date;
                    aBookingHall_ServiceEN.PercentTax = aListTemp[i].PercentTax;
                    aBookingHall_ServiceEN.Quantity = aListTemp[i].Quantity;
                    aListSelected.Add(aBookingHall_ServiceEN);
                }
                dgvServiceInHall.DataSource = aListSelected;
                dgvServiceInHall.RefreshDataSource();
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmIns_BookingHalls_Services.grvHalls_RowClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
        }
 private void grvListBookingHalls_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     int IDBookingHall = Convert.ToInt32(grvListBookingHalls.GetFocusedRowCellValue("ID"));
     ServicesBO aServicesBO = new ServicesBO();
     BookingHalls_ServicesBO aBookingHalls_ServicesBO = new BookingHalls_ServicesBO();
     List<BookingHall_ServiceEN> aListBookingHall_ServiceEN = new List<BookingHall_ServiceEN>();
     List<BookingHalls_Services> aListTemp = aBookingHalls_ServicesBO.Select_ByIDBookingHall(IDBookingHall);
     BookingHall_ServiceEN aBookingHall_ServiceEN;
     for (int i = 0; i < aListTemp.Count; i++)
     {
         aBookingHall_ServiceEN = new BookingHall_ServiceEN();
         aBookingHall_ServiceEN.ID = aListTemp[i].ID;
         aBookingHall_ServiceEN.Info = aListTemp[i].Info;
         aBookingHall_ServiceEN.Type = aListTemp[i].Type;
         aBookingHall_ServiceEN.Status = aListTemp[i].Status;
         aBookingHall_ServiceEN.Disable = aListTemp[i].Disable;
         aBookingHall_ServiceEN.IDBookingHall = aListTemp[i].IDBookingHall;
         aBookingHall_ServiceEN.IDService = aListTemp[i].IDService;
         aBookingHall_ServiceEN.Service_Name = aServicesBO.Select_ByID(aListTemp[i].IDService).Name;
         aBookingHall_ServiceEN.Service_Unit = aServicesBO.Select_ByID(aListTemp[i].IDService).Unit;
         aBookingHall_ServiceEN.Cost = aListTemp[i].CostRef_Services;
         aBookingHall_ServiceEN.CostRef_Services = aListTemp[i].CostRef_Services;
         aBookingHall_ServiceEN.Date = aListTemp[i].Date;
         aBookingHall_ServiceEN.PercentTax = aListTemp[i].PercentTax;
         aBookingHall_ServiceEN.Quantity = aListTemp[i].Quantity;
         aListBookingHall_ServiceEN.Add(aBookingHall_ServiceEN);
     }
     dgvServiceInBookingHall.DataSource = aListBookingHall_ServiceEN;
     dgvServiceInBookingHall.RefreshDataSource();
 }
 private void grvListBookingHalls_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     try
     {
         int IDBookingHall = Convert.ToInt32(grvListBookingHalls.GetFocusedRowCellValue("ID"));
         ServicesBO aServicesBO = new ServicesBO();
         BookingHalls_ServicesBO aBookingHalls_ServicesBO = new BookingHalls_ServicesBO();
         List<BookingHall_ServiceEN> aListBookingHall_ServiceEN = new List<BookingHall_ServiceEN>();
         List<BookingHalls_Services> aListTemp = aBookingHalls_ServicesBO.Select_ByIDBookingHall(IDBookingHall);
         BookingHall_ServiceEN aBookingHall_ServiceEN;
         for (int i = 0; i < aListTemp.Count; i++)
         {
             aBookingHall_ServiceEN = new BookingHall_ServiceEN();
             aBookingHall_ServiceEN.ID = aListTemp[i].ID;
             aBookingHall_ServiceEN.Info = aListTemp[i].Info;
             aBookingHall_ServiceEN.Type = aListTemp[i].Type;
             aBookingHall_ServiceEN.Status = aListTemp[i].Status;
             aBookingHall_ServiceEN.Disable = aListTemp[i].Disable;
             aBookingHall_ServiceEN.IDBookingHall = aListTemp[i].IDBookingHall;
             aBookingHall_ServiceEN.IDService = aListTemp[i].IDService;
             aBookingHall_ServiceEN.Service_Name = aServicesBO.Select_ByID(aListTemp[i].IDService).Name;
             aBookingHall_ServiceEN.Service_Unit = aServicesBO.Select_ByID(aListTemp[i].IDService).Unit;
             aBookingHall_ServiceEN.Cost = aListTemp[i].CostRef_Services;
             aBookingHall_ServiceEN.CostRef_Services = aListTemp[i].CostRef_Services;
             aBookingHall_ServiceEN.Date = aListTemp[i].Date;
             aBookingHall_ServiceEN.PercentTax = aListTemp[i].PercentTax;
             aBookingHall_ServiceEN.Quantity = aListTemp[i].Quantity;
             aListBookingHall_ServiceEN.Add(aBookingHall_ServiceEN);
         }
         dgvServiceInBookingHall.DataSource = aListBookingHall_ServiceEN;
         dgvServiceInBookingHall.RefreshDataSource();
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmTsk_UnpayBookingHs.grvListBookingHalls_RowClick\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void btnSelect_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                BookingHall_ServiceEN aBookingHall_ServiceEN = new BookingHall_ServiceEN();
                int IDService = Convert.ToInt32(grvService.GetFocusedRowCellValue("ID"));
                aBookingHall_ServiceEN.IDService = IDService;
                aBookingHall_ServiceEN.IDBookingHall = this.IDBookingHall;
                aBookingHall_ServiceEN.Service_Name = grvService.GetFocusedRowCellValue("Name").ToString();
                aBookingHall_ServiceEN.Cost = Convert.ToDecimal(grvService.GetFocusedRowCellValue("CostRef"));
                aBookingHall_ServiceEN.CostRef_Services = Convert.ToDecimal(grvService.GetFocusedRowCellValue("CostRef"));
                aBookingHall_ServiceEN.Service_Unit = grvService.GetFocusedRowCellValue("Unit").ToString();
                aBookingHall_ServiceEN.Date = dtpDate.DateTime;
                aBookingHall_ServiceEN.Quantity = 1;
                aBookingHall_ServiceEN.PercentTax = 10;

                this.aListSelected.Insert(0, aBookingHall_ServiceEN);
                dgvServiceInHall.DataSource = aListSelected;
                dgvServiceInHall.RefreshDataSource();

                this.IsDataChange = true;

            }
            catch (Exception ex)
            {
                MessageBox.Show("frmIns_BookingHalls_Services.btnSelect_ButtonClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
        }
        public void LoadServiceInBookingHall(int IDBookingHall)
        {
            try
            {
                ServicesBO aServicesBO = new ServicesBO();
                BookingHalls_ServicesBO aBookingHalls_ServicesBO = new BookingHalls_ServicesBO();
                List<BookingHalls_Services> aListTemp = aBookingHalls_ServicesBO.Select_ByIDBookingHall(IDBookingHall);
                BookingHall_ServiceEN aBookingHall_ServiceEN;
                for (int i = 0; i < aListTemp.Count; i++)
                {
                    aBookingHall_ServiceEN = new BookingHall_ServiceEN();
                    aBookingHall_ServiceEN.ID = aListTemp[i].ID;
                    aBookingHall_ServiceEN.Info = aListTemp[i].Info;
                    aBookingHall_ServiceEN.Type = aListTemp[i].Type;
                    aBookingHall_ServiceEN.Status = aListTemp[i].Status;
                    aBookingHall_ServiceEN.Disable = aListTemp[i].Disable;
                    aBookingHall_ServiceEN.IDBookingHall = aListTemp[i].IDBookingHall;
                    aBookingHall_ServiceEN.IDService = aListTemp[i].IDService;
                    aBookingHall_ServiceEN.Service_Name = aServicesBO.Select_ByID(aListTemp[i].IDService).Name;
                    aBookingHall_ServiceEN.Service_Unit = aServicesBO.Select_ByID(aListTemp[i].IDService).Unit;

                    aBookingHall_ServiceEN.Cost = aListTemp[i].Cost == null ? aListTemp[i].CostRef_Services : aListTemp[i].Cost;
                    aBookingHall_ServiceEN.CostRef_Services = aListTemp[i].CostRef_Services;
                    aBookingHall_ServiceEN.Date = aListTemp[i].Date;
                    aBookingHall_ServiceEN.PercentTax = aListTemp[i].PercentTax;
                    aBookingHall_ServiceEN.Quantity = aListTemp[i].Quantity;

                    aBookingHall_ServiceEN.Tag = aListTemp[i].Tag;

                    aListSelected.Add(aBookingHall_ServiceEN);
                }
                dgvServiceInHall.DataSource = aListSelected;
                dgvServiceInHall.RefreshDataSource();

                CustomersBO aCustomersBO = new CustomersBO();
                BookingRs_BookingHsBO aBookingRs_BookingHsBO = new BookingRs_BookingHsBO();
                List<Customers> aListCustomerRoom = new List<Customers>();
                List<Customers> aListCustomerHall = aCustomersBO.SelectListCustomer_ByIDBookingH(this.IDBookingHall);
                if (this.aNewPayment != null)
                {
                    if (this.aNewPayment.IDBookingR > 0)
                    {
                       aListCustomerRoom = aCustomersBO.SelectListCustomer_ByIDBookingR(this.aNewPayment.IDBookingR.GetValueOrDefault(0));
                    }
                }
                aListCustomerHall.AddRange(aListCustomerRoom);
                lueUserInHall.DataSource = aListCustomerHall;
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmIns_BookingHalls_Services.grvHalls_RowClick\n" + ex.ToString(), "Error ", MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
        }