public frmRpt_Performance_Rooms(DateTime From, DateTime To, int IDLang)
        {
            InitializeComponent();
            this.From = From;
            this.To = To;
            this.IDLang = IDLang;

            lblFrom.Text = From.ToString();
            lblTo.Text = To.ToString();
            RoomsBO aRoomsBO = new RoomsBO();
            ReportTaskBO aReportTaskBO = new ReportTaskBO();
            List<Rooms> aListRooms = aRoomsBO.Select_ByIDLang(IDLang);
            List<string> aListCodeRoom = new List<string>();
            for (int i = 0; i < aListRooms.Count; i++)
            {
                string CodeRoom = aListRooms[i].Code;
                aListCodeRoom.Add(CodeRoom);
            }

            List<EfficiencyEN> aListEfficiencyEN = aReportTaskBO.GetEfficiencyRoom(From, To, aListCodeRoom);

            //List<EfficiencyEN> List1 = new List<EfficiencyEN>();
            //List<EfficiencyEN> List2 = new List<EfficiencyEN>();

            //List1 = aListEfficiencyEN.GetRange(0, Convert.ToInt32(Math.Floor(Convert.ToDouble(aListEfficiencyEN.Count / 2))));
            //List2 = aListEfficiencyEN.GetRange(Convert.ToInt32(Math.Ceiling(Convert.ToDouble(aListEfficiencyEN.Count / 2))), aListEfficiencyEN.Count);

            this.DataSource = aListEfficiencyEN;
            cellSkuRoom.DataBindings.Add("Text", this.DataSource, "Sku");
            cellPerformance.DataBindings.Add("Text", this.DataSource, "Efficiency");

            double x = aListEfficiencyEN.Select(a => a.Efficiency).Sum();
            double y = aListEfficiencyEN.Count;
            lblPerformance.Text = (Math.Round(x / y, 2)).ToString() + "%";
        }
        public frmRpt_Revenue_Rooms(DateTime From, DateTime To, int IDLang)
        {
            InitializeComponent();
            this.From = From;
            this.To = To;
            this.IDLang = IDLang;

            try
            {
                lblFrom.Text = From.ToString();
                lblTo.Text = To.ToString();
                ReportTaskBO aReportTaskBO = new ReportTaskBO();
                RoomsBO aRoomsBO = new RoomsBO();
                List<Rooms> aListRooms = aRoomsBO.Select_ByIDLang(IDLang);
                List<string> aListCodeRoom = new List<string>();
                for (int i = 0; i < aListRooms.Count; i++)
                {
                    string CodeRoom = aListRooms[i].Code;
                    aListCodeRoom.Add(CodeRoom);
                }
                List<RevenueEN> aListRevenueEN = aReportTaskBO.GetRevenueRoom(From, To, aListCodeRoom);
                this.DataSource = aListRevenueEN;

                cellSkuRoom.DataBindings.Add("Text", this.DataSource, "Sku");
                cellRevenue.DataBindings.Add("Text", this.DataSource, "Revenue","{0:0,0}");

                double TotalMoney = aListRevenueEN.Select(r => r.Revenue).Sum();
                lblRevenue.Text = String.Format("{0:0,0} (VND)",TotalMoney);
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmRpt_Revenue_Rooms.frmRpt_Revenue_Rooms\n" + ex.ToString());
            }
        }
        public void LoadDataRevenueRooms(DateTime FromDate,DateTime ToDate)
        {
            try
            {
                if (FromDate >= ToDate)
                {
                    MessageBox.Show("Vui lòng nhập ngày bắt đầu kiểm tra nhỏ hơn ngày kết thúc .", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    ReportTaskBO aReportTaskBO = new ReportTaskBO();
                    RoomsBO aRoomsBO = new RoomsBO();
                    List<Rooms> aListRooms = aRoomsBO.Select_ByIDLang(1);
                    List<string> aListCodeRoom = new List<string>();
                    for (int i = 0; i < aListRooms.Count; i++)
                    {
                        string CodeRoom = aListRooms[i].Code;
                        aListCodeRoom.Add(CodeRoom);
                    }
                    List<RevenueEN> aListRevenueEN = aReportTaskBO.GetRevenueRoom(this.FromDate,this.ToDate,aListCodeRoom);
                    colRevenue.DisplayFormat.FormatType = FormatType.Numeric;
                    colRevenue.DisplayFormat.FormatString = "{0:0,0}";
                    dgvRevenue.DataSource = aListRevenueEN;

                    double TotalMoney = aListRevenueEN.Select(r => r.Revenue).Sum();
                    lblTotalRevenue.Text = String.Format("{0:0,0}", TotalMoney);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmTsk_Calculator_Revenue.LoadDataRevenueRooms\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            ReportTaskBO aReportTaskBO = new ReportTaskBO();

            aRet = aReportTaskBO.RoomsPerformanceInMonth(DateTime.Parse(dtpCheckPoint.Text));
            DataShow = ConvertToForShowReport(aRet);

            //gridView1. = ConvertToForShowReport(aRet);
            gridControl1.DataSource = ConvertToForShowReport(aRet);
            //gridControl1.DataBindings.Add("Text", DataShow, "Sku");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date1");

            //gridControl1.DataBindings.Add("Text", DataShow, "Date2");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date3");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date4");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date5");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date6");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date7");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date8");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date9");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date10");

            //gridControl1.DataBindings.Add("Text", DataShow, "Date11");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date12");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date13");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date14");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date15");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date16");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date17");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date18");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date19");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date20");

            //gridControl1.DataBindings.Add("Text", DataShow, "Date21");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date22");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date23");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date24");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date25");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date26");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date27");
            //gridControl1.DataBindings.Add("Text", DataShow, "Date28");

            //if (aRet.Count >= 30)
            //{
            //    gridControl1.DataBindings.Add("Text", DataShow, "Date29");
            //    gridControl1.DataBindings.Add("Text", DataShow, "Date30");
            //}
            //if (aRet.Count == 31)
            //{
            //    gridControl1.DataBindings.Add("Text", DataShow, "Date31");
            //}
        }
        public frmRpt_StatusInMonth_Rooms()
        {
            InitializeComponent();

            ReportTaskBO aReportTaskBO = new ReportTaskBO();
            List<List<RptRoomStatusEN>> aRet = new List<List<RptRoomStatusEN>>();

            //DateTime dt = DateTime.Now.AddMonths(-5);

            XRBinding aXRBinding = new XRBinding();

            aRet = aReportTaskBO.RoomsPerformanceInMonth(DateTime.Now);

            this.DataSource = ConvertToForShowReport(aRet);

            colSku.DataBindings.Add("Text", this.DataSource, "Sku");

            col1.DataBindings.Add("Text", this.DataSource, "Date1");

            col2.DataBindings.Add("Text", this.DataSource, "Date2");
            col3.DataBindings.Add("Text", this.DataSource, "Date3");
            col4.DataBindings.Add("Text", this.DataSource, "Date4");
            col5.DataBindings.Add("Text", this.DataSource, "Date5");
            col6.DataBindings.Add("Text", this.DataSource, "Date6");
            col7.DataBindings.Add("Text", this.DataSource, "Date7");
            col8.DataBindings.Add("Text", this.DataSource, "Date8");
            col9.DataBindings.Add("Text", this.DataSource, "Date9");
            col10.DataBindings.Add("Text", this.DataSource, "Date10");

            col11.DataBindings.Add("Text", this.DataSource, "Date11");
            col12.DataBindings.Add("Text", this.DataSource, "Date12");
            col13.DataBindings.Add("Text", this.DataSource, "Date13");
            col14.DataBindings.Add("Text", this.DataSource, "Date14");
            col15.DataBindings.Add("Text", this.DataSource, "Date15");
            col16.DataBindings.Add("Text", this.DataSource, "Date16");
            col17.DataBindings.Add("Text", this.DataSource, "Date17");
            col18.DataBindings.Add("Text", this.DataSource, "Date18");
            col19.DataBindings.Add("Text", this.DataSource, "Date19");
            col20.DataBindings.Add("Text", this.DataSource, "Date20");

            col21.DataBindings.Add("Text", this.DataSource, "Date21");
            col22.DataBindings.Add("Text", this.DataSource, "Date22");
            col23.DataBindings.Add("Text", this.DataSource, "Date23");
            col24.DataBindings.Add("Text", this.DataSource, "Date24");
            col25.DataBindings.Add("Text", this.DataSource, "Date25");
            col26.DataBindings.Add("Text", this.DataSource, "Date26");
            col27.DataBindings.Add("Text", this.DataSource, "Date27");
            col28.DataBindings.Add("Text", this.DataSource, "Date28");

            if (aRet.Count >= 30)
            {
                col29.DataBindings.Add("Text", this.DataSource, "Date29");
                col30.DataBindings.Add("Text", this.DataSource, "Date30");
            }
            if (aRet.Count == 31)
            {
                col31.DataBindings.Add("Text", this.DataSource, "Date31");
            }

            colTotalCustomer.DataBindings.Add("Text", this.DataSource, "TotalCustomer");

            string fromDateToDate=string.Empty;

            if(aRet.Count == 28 )
            {
                fromDateToDate="Từ ngày 01 đến ngày 28 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString();
            }
            else if(aRet.Count == 30)
            {
                fromDateToDate="Từ ngày 01 đến ngày 30 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString();
            }
            else
            {
                fromDateToDate="Từ ngày 01 đến ngày 31 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString();
            }

            lblFromDateToDate.Text = fromDateToDate;
            lblDatePrint.Text = "Ngày in:" + DateTime.Now.ToString("dd-MM-yyyy");
        }