Example #1
0
    public void BindData(ReportFilter filter)
    {
        try
        {
            const string hrDepartment = @"Trần Thị Việt Hồng";
            const string creator      = @"Trần Thị Thu";

            var reportDate = filter.ReportedDate;
            lblReportDate.Text   = string.Format(lblReportDate.Text, reportDate.Day, reportDate.Month, reportDate.Year);
            lblHRDepartment.Text = hrDepartment;
            lblCreator.Text      = creator;

            var organization = cat_DepartmentServices.GetByDepartments(filter.SessionDepartment);

            if (organization == null)
            {
                return;
            }
            var departments   = filter.SelectedDepartment;
            var arrDepartment = departments.Split(new[] { ',' }, StringSplitOptions.None);
            for (var i = 0; i < arrDepartment.Length; i++)
            {
                arrDepartment[i] = "'{0}'".FormatWith(arrDepartment[i]);
            }
            // get data from date
            var fromDate = filter.StartDate != null
                ? filter.StartDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
                : string.Empty;

            // get data to date
            var toDate = filter.EndDate != null
                ? filter.EndDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
                : string.Empty;

            var table = SQLHelper.ExecuteTable(
                SQLBusinessSalaryAdapter.GetStore_BusinessRaiseSalary(string.Join(",", arrDepartment),
                                                                      filter.WhereClause, fromDate, toDate));
            DataSource = table;

            xrCellEmployeeCode.DataBindings.Add("Text", DataSource, "EmployeeCode");
            xrCellFullName.DataBindings.Add("Text", DataSource, "FullName");
            xrCellBirthYear.DataBindings.Add("Text", DataSource, "BirthYear");
            xrCellPosition.DataBindings.Add("Text", DataSource, "PositionName");
            xrCellDepartment.DataBindings.Add("Text", DataSource, "DepartmentName");
            xrCellWorkingDate.DataBindings.Add("Text", DataSource, "ParticipationDate", "{0:dd/MM/yyyy}");
            xrCellLastRaiseSalaryDate.DataBindings.Add("Text", DataSource, "EffectiveDate", "{0:dd/MM/yyyy}");
            xrCellOldSalary.DataBindings.Add("Text", DataSource, "SalaryBasic");
            GroupHeader1.GroupFields.AddRange(new[] { new GroupField("DepartmentId", XRColumnSortOrder.Ascending) });
            xrt_GroupDepartment.DataBindings.Add("Text", DataSource, "DepartmentName");
        }
        catch (Exception ex)
        {
            Dialog.ShowNotification("Có lỗi xảy ra: " + ex.Message);
        }
    }
Example #2
0
    public void BindData(ReportFilter filter)
    {
        try
        {
            var organization = cat_DepartmentServices.GetByDepartments(filter.SessionDepartment);

            if (organization == null)
            {
                return;
            }
            var departments   = filter.SelectedDepartment;
            var arrDepartment = departments.Split(new[] { ',' }, StringSplitOptions.None);
            for (var i = 0; i < arrDepartment.Length; i++)
            {
                arrDepartment[i] = "'{0}'".FormatWith(arrDepartment[i]);
            }

            // get data from date
            var fromDate = filter.StartDate != null
                ? filter.StartDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
                : string.Empty;

            // get data to date
            var toDate = filter.EndDate != null
                ? filter.EndDate.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)
                : string.Empty;

            var table = SQLHelper.ExecuteTable(
                SQLBusinessSalaryAdapter.GetStore_BusinessPersonalTax(string.Join(",", arrDepartment),
                                                                      filter.WhereClause, fromDate, toDate));
            DataSource = table;

            xrCellEmployeeCode.DataBindings.Add("Text", DataSource, "EmployeeCode");
            xrCellFullName.DataBindings.Add("Text", DataSource, "FullName");
            xrCellPersonalTax.DataBindings.Add("Text", DataSource, "PersonalTaxCode");
            xrCellDepartment.DataBindings.Add("Text", DataSource, "DepartmentName");
            GroupHeader1.GroupFields.AddRange(new[] { new GroupField("DepartmentId", XRColumnSortOrder.Ascending) });
            xrt_GroupDepartment.DataBindings.Add("Text", DataSource, "DepartmentName");
        }
        catch (Exception ex)
        {
            Dialog.ShowNotification("Có lỗi xảy ra: " + ex.Message);
        }
    }