Beispiel #1
0
        public void BindData(ReportFilter filter)
        {
            try
            {
                var arrDepartment = string.IsNullOrEmpty(filter.SelectedDepartment)
                    ? new string[] { }
                    : filter.SelectedDepartment.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                for (var i = 0; i < arrDepartment.Length; i++)
                {
                    arrDepartment[i] = "'{0}'".FormatWith(arrDepartment[i]);
                }
                var control  = new ReportController();
                var location = control.GetCityName(filter.SessionDepartment);
                lblReportDate.Text = string.Format(lblReportDate.Text, location, DateTime.Now.Day,
                                                   DateTime.Now.Month, DateTime.Now.Year);
                var table = SQLHelper.ExecuteTable(
                    SQLManagementAdapter.GetStore_ReportListEmployeeReceivesGift8_3(
                        string.Join(",", arrDepartment)));
                DataSource = table;

                xrTableCellEmployeeCode.DataBindings.Add("Text", DataSource, "EmployeeCode");
                xrTableCellFullName.DataBindings.Add("Text", DataSource, "FullName");
                xrTableCellDateBirth.DataBindings.Add("Text", DataSource, "BirthDate", "{0:dd/MM/yyyy}");
                xrTableCellSex.DataBindings.Add("Text", DataSource, "Sex");
                xrTableCellIDNumber.DataBindings.Add("Text", DataSource, "IDNumber");
                xrTableCellDepartmentName.DataBindings.Add("Text", DataSource, "DepartmentName");
                xrTableCellDescription.DataBindings.Add("Text", DataSource, "Description");
                GroupHeader2.GroupFields.AddRange(new[] {
                    new GroupField("ConstructionId", XRColumnSortOrder.Ascending)
                });
                xrGroupConstruction.DataBindings.Add("Text", DataSource, "ConstructionName");
            }
            catch
            {
            }
        }