public void ReloadData()
        {
            try
            {
                ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO();
                dgvSerGroup.DataSource = aServiceGroupsBO.Sel_all();
                dgvSerGroup.RefreshDataSource();

                lueType.Properties.DataSource = CORE.CONSTANTS.ListServiceTypes;
                lueType.Properties.DisplayMember = "Name";
                lueType.Properties.ValueMember = "ID";
                lueType.EditValue = CORE.CONSTANTS.SelectedServiceType(2).ID;

            }
            catch (Exception ex)
            {
                MessageBox.Show("frmIns_ServiceGroups.ReloadData\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public void ReloadData()
 {
     try
     {
         ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO();
         List<ServiceGroups> aListServiceGroups = aServiceGroupsBO.Sel_all();
         lueIDServiceGroup.Properties.DataSource = aListServiceGroups;
         lueIDServiceGroup.Properties.DisplayMember = "Name";
         lueIDServiceGroup.Properties.ValueMember = "ID";
         if (aListServiceGroups.Count > 0)
         {
             lueIDServiceGroup.EditValue = aListServiceGroups[0].ID;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmIns_Services.ReloadData\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void frmUpd_Services_Load(object sender, EventArgs e)
 {
     try
     {
         ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO();
         lueIDServiceGroup.Properties.DataSource = aServiceGroupsBO.Sel_all();
         lueIDServiceGroup.Properties.DisplayMember = "Name";
         lueIDServiceGroup.Properties.ValueMember = "ID";
         ServicesBO aServiceBO = new ServicesBO();
         Services aService = aServiceBO.Select_ByID(ID);
         lblIDService.Text = ID.ToString();
         txtName.Text = aService.Name;
         txtCost.Text = String.Format("{0:0,0}",aService.CostRef);
         cboDisable.Text = aService.Disable.ToString();
         cboStatus.SelectedIndex = Convert.ToInt32(aService.Status - 1);
         cboType.SelectedIndex = Convert.ToInt32(aService.Type - 1);
         txtUnit.Text = aService.Unit;
         lueIDServiceGroup.EditValue = aService.IDServiceGroups;
     }
     catch (Exception ex)
     {
         MessageBox.Show("frmUpd_Services.frmUpd_Services_Load\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void btnPrintPayment_OldStyle_Click(object sender, EventArgs e)
        {
            ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO();
            List<ServiceGroups> aListServiceGroups = new List<ServiceGroups>();
            aListServiceGroups = aServiceGroupsBO.Sel_all().OrderBy(p => p.Order).ToList();
            List<int> ListIDServiceGroup = new List<int>();
            ListIDServiceGroup.AddRange(aListServiceGroups.Select(p => p.ID).ToList());

            List<RptPaymentStyle1_ForDisplay> aList = this.aNewPaymentEN.ConvertDataFor_RptPaymentStyle1(ListIDServiceGroup);
            frmTsk_ReportPaymentStyle1 afrm = new frmTsk_ReportPaymentStyle1(aList.OrderBy(p => p.Date).ToList(), aListServiceGroups, this.aNewPaymentEN.NameCompany, this.aNewPaymentEN.AddressCompany, this.aNewPaymentEN.NameCustomerGroup, this.aNewPaymentEN.InvoiceNumber, this.aNewPaymentEN.GetFirstDate(), this.aNewPaymentEN.GetLastDate(), this.aNewPaymentEN.BookingHMoney, this.aNewPaymentEN.BookingRMoney, this.IDBookingR);
            afrm.ShowDialog();
        }
        private void frmTsk_ReportPaymentStyle1_Load(object sender, EventArgs e)
        {
            ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO();
            List<ServiceGroups> aList = aServiceGroupsBO.Sel_all().Where(p=>aListIDCustomerGroup.Contains(p.ID)).ToList();

            //GridColumn aCol = new GridColumn();
            //aCol.Caption = "Ngày";
            //aCol.FieldName = "Date";
            //aCol.Visible = true;
            //this.gridView1.Columns.Add(aCol);

            //aCol = new GridColumn();
            //aCol.Caption = "Ghi chú";
            //aCol.FieldName = "Note";
            //aCol.Visible = true;
            //this.gridView1.Columns.Add(aCol);

            //aCol = new GridColumn();
            //aCol.Caption = "Số người";
            //aCol.FieldName = "CountCustomerInGroup";
            //aCol.DisplayFormat.FormatType = FormatType.Numeric;
            //aCol.DisplayFormat.FormatString = "{0:0,0}";
            //aCol.Visible = true;
            //this.gridView1.Columns.Add(aCol);

            //aCol = new GridColumn();
            //aCol.Caption = "Tiền phòng";
            //aCol.FieldName = "Room_Fee";
            //aCol.DisplayFormat.FormatType = FormatType.Numeric;
            //aCol.DisplayFormat.FormatString = "{0:0,0}";
            //aCol.Visible = true;
            //this.gridView1.Columns.Add(aCol);

            //aCol = new GridColumn();
            //aCol.Caption = "Tiền hội trường";
            //aCol.FieldName = "Hall_Fee";
            //aCol.DisplayFormat.FormatType = FormatType.Numeric;
            //aCol.DisplayFormat.FormatString = "{0:0,0}";
            //aCol.Visible = true;
            //this.gridView1.Columns.Add(aCol);

            GridColumn aCol = new GridColumn();
            for (int i = 0; i < this.aListIDCustomerGroup.Count ; i++)
            {
                List<ServiceGroups> aListItem = aList.Where(p => p.ID == this.aListIDCustomerGroup[i]).ToList();
                if (aListItem.Count > 0)
                {
                    aCol = new GridColumn();
                    aCol.Caption = aListItem[0].Name;
                    int tempt =  2 + i ;
                    aCol.FieldName = "ServiceGroup"+ tempt +"_Fee";
                    aCol.DisplayFormat.FormatType = FormatType.Numeric;
                    aCol.DisplayFormat.FormatString = "{0:0,0}";
                    aCol.Visible = true;
                    this.grvReportPaymentStyle1.Columns.Add(aCol);
                }
            }

            this.dgvReportPaymentStyle1.MainView = this.grvReportPaymentStyle1;
            this.dgvReportPaymentStyle1.DataSource = this.aListRet;
        }