public List<RptPaymentStyle1_ForDisplay> ConvertDataFor_RptPaymentStyle1(List<int> ListIDServiceGroup)
        {
            DateTime FirstDateReport = this.GetFirstDate();
               DateTime LastDateReport = this.GetLastDate();

               List<ServiceUsedEN> ListServiceInOnceDay = new List<ServiceUsedEN>();
               List<RptPaymentStyle1> aListRet = new List<RptPaymentStyle1>();
               List<RptPaymentStyle1_ForDisplay> aListRetView = new List<RptPaymentStyle1_ForDisplay>();

               RptPaymentStyle1 ItemSumGroupInOnceDay = new RptPaymentStyle1();

               double Loop = (LastDateReport.Date - FirstDateReport.Date).TotalDays ;
               for (double i = 0; i <= Loop; i++)

            {

               ItemSumGroupInOnceDay = new RptPaymentStyle1();
               // Lay tong so nguoi cua doan
               ItemSumGroupInOnceDay.CountCustomerInGroup = this.GetNumCustomerInOnceDay(FirstDateReport.AddDays(i));
               ItemSumGroupInOnceDay.Date = FirstDateReport.AddDays(i).Date;

               // tien phong

               ItemSumGroupInOnceDay.ServiceGroup_Fee.Insert(0, this.GetRoomFeeInOnceDay(FirstDateReport.AddDays(i)));

               ItemSumGroupInOnceDay.Note = "Tiền phòng";
               if (ItemSumGroupInOnceDay.ServiceGroup_Fee[0] > 0)
               {
                   aListRet.Insert(0, ItemSumGroupInOnceDay);
               }
               else {
                   aListRet.Insert(0, new RptPaymentStyle1());
               }

               ItemSumGroupInOnceDay = new RptPaymentStyle1();
               ItemSumGroupInOnceDay.Date = FirstDateReport.AddDays(i).Date;
               // gop cung cot so 0
               ItemSumGroupInOnceDay.ServiceGroup_Fee.Insert(1, this.GetHallFeeInOnceDay(FirstDateReport.AddDays(i)));
               ItemSumGroupInOnceDay.Note = "Tiền hội trường";
               if (ItemSumGroupInOnceDay.ServiceGroup_Fee[1] > 0)
               {
                   aListRet.Insert(1, ItemSumGroupInOnceDay);
               }
               else
               {
                   aListRet.Insert(1, new RptPaymentStyle1());
               }

               //----------------------------------------------
               // Lay danh sach dich vu phong dung trong 1 ngay
               ListServiceInOnceDay = GetListServiceInOnceDay(this.GetAllServiceUsedInRoom(), FirstDateReport.AddDays(i));

               // lay them danh sach dich vu hoi truong trong cung ngay roi noi vao list tren
               ListServiceInOnceDay.AddRange(GetListServiceInOnceDay(this.GetAllServiceUsedInHall(), FirstDateReport.AddDays(i)));
               aListRet.AddRange(SumGroupServiceFeeInOnceDay(ListIDServiceGroup, ListServiceInOnceDay));

               }

               // convert data sang dang phu hop de hien thi va in
               for (int ii = 0; ii < aListRet.Count; ii++)
               {
               aListRetView.Add(new RptPaymentStyle1_ForDisplay(aListRet[ii]));
               }

               int alist = aListRetView.RemoveAll(p => p.Date == DateTime.MinValue);
               return aListRetView;
        }
        public RptPaymentStyle1_ForDisplay(RptPaymentStyle1 aItem)
        {
            this.Index = aItem.Index;
            this.CountCustomerInGroup = aItem.CountCustomerInGroup;
            this.Date = aItem.Date;
            this.Note = aItem.Note;

            this.Room_Fee = aItem.ServiceGroup_Fee[0];
            this.Hall_Fee = aItem.ServiceGroup_Fee[1];
            this.ServiceGroup2_Fee = aItem.ServiceGroup_Fee[2];
            this.ServiceGroup3_Fee = aItem.ServiceGroup_Fee[3];
            this.ServiceGroup4_Fee = aItem.ServiceGroup_Fee[4];
            this.ServiceGroup5_Fee = aItem.ServiceGroup_Fee[5];
            this.ServiceGroup6_Fee = aItem.ServiceGroup_Fee[6];
            this.ServiceGroup7_Fee = aItem.ServiceGroup_Fee[7];
            this.ServiceGroup8_Fee = aItem.ServiceGroup_Fee[8];
            this.ServiceGroup9_Fee = aItem.ServiceGroup_Fee[9];
            this.ServiceGroup10_Fee = aItem.ServiceGroup_Fee[10];
            this.ServiceGroup11_Fee = aItem.ServiceGroup_Fee[11];
            this.ServiceGroup12_Fee = aItem.ServiceGroup_Fee[12];
            this.ServiceGroup13_Fee = aItem.ServiceGroup_Fee[13];
            this.ServiceGroup14_Fee = aItem.ServiceGroup_Fee[14];
            this.ServiceGroup15_Fee = aItem.ServiceGroup_Fee[15];
        }
        // tra ra 1 list cac ban ghi ve cac dich vu gop nhom trong 1 nga
        private List<RptPaymentStyle1> SumGroupServiceFeeInOnceDay(List<int> ListIDServiceGroup, List<ServiceUsedEN> ListDataInOnceDay)
        {
            // List<Decimal>

               List<RptPaymentStyle1> DataInOnceDay = new List<RptPaymentStyle1>();
               if (ListDataInOnceDay.Count > 0)
               {
               DateTime CheckDate = ListDataInOnceDay[0].DateUsed.GetValueOrDefault();

               RptPaymentStyle1 ItemSumGroupInOnceDay= new RptPaymentStyle1();
               for (int i = 0; i < ListIDServiceGroup.Count; i++)
               {
                   //------------------------------------------------------------------------------------
                   ItemSumGroupInOnceDay = new RptPaymentStyle1();
                   // Lay tong so nguoi cua doan
                   ItemSumGroupInOnceDay.CountCustomerInGroup = this.GetNumCustomerInOnceDay(CheckDate);
                   ItemSumGroupInOnceDay.Date = CheckDate.Date;

                   ItemSumGroupInOnceDay.Note = this.GetNote(ListIDServiceGroup[i], ListDataInOnceDay);
                   // Gan tong tien dich vu vao cot thu 3 tro di tuong ung trong ServiceGroup_Fee
                   ItemSumGroupInOnceDay.ServiceGroup_Fee.Insert(i+2, this.SumEachGroupServiceFee(ListIDServiceGroup[i], ListDataInOnceDay));
                   if (ItemSumGroupInOnceDay.ServiceGroup_Fee[i + 2] > 0)
                   {
                       DataInOnceDay.Add(ItemSumGroupInOnceDay);
                   }

               }
               }
               return DataInOnceDay;
        }
        public void ConvertForViewAndPrint(RptPaymentStyle1 aItem)
        {
            this.Index = aItem.Index;
            this.CountCustomerInGroup = aItem.CountCustomerInGroup;
            this.Date = aItem.Date;
            this.Note = aItem.Note;

            this.IDBookingR = aItem.IDBookingR;
            this.InvoiceDate = aItem.InvoiceDate;
            this.InvoiceNumber = aItem.InvoiceNumber;

            this.Room_Fee = aItem.ServiceGroup_Fee[0];
            this.Hall_Fee = aItem.ServiceGroup_Fee[1];
            this.ServiceGroup2_Fee = aItem.ServiceGroup_Fee[2];
            this.ServiceGroup3_Fee = aItem.ServiceGroup_Fee[3];
            this.ServiceGroup4_Fee = aItem.ServiceGroup_Fee[4];
            this.ServiceGroup5_Fee = aItem.ServiceGroup_Fee[5];
            this.ServiceGroup6_Fee = aItem.ServiceGroup_Fee[6];
            this.ServiceGroup7_Fee = aItem.ServiceGroup_Fee[7];
            this.ServiceGroup8_Fee = aItem.ServiceGroup_Fee[8];
            this.ServiceGroup9_Fee = aItem.ServiceGroup_Fee[9];
            this.ServiceGroup10_Fee = aItem.ServiceGroup_Fee[10];
            this.ServiceGroup11_Fee = aItem.ServiceGroup_Fee[11];
            this.ServiceGroup12_Fee = aItem.ServiceGroup_Fee[12];
            this.ServiceGroup13_Fee = aItem.ServiceGroup_Fee[13];
            this.ServiceGroup14_Fee = aItem.ServiceGroup_Fee[14];
            this.ServiceGroup15_Fee = aItem.ServiceGroup_Fee[15];
        }