Ejemplo n.º 1
0
        public void BindData(ReportFilter filter)
        {
            const string type     = "ThuyenChuyenDieuChuyen";
            var          recordId = filter.RecordId;
            var          fromDate = filter.StartDate != null?filter.StartDate.Value.ToString("yyyy-dd-MM") : string.Empty;

            var endDate = filter.EndDate != null?filter.EndDate.Value.ToString("yyyy-dd-MM") : string.Empty;

            var toDate = filter.ReportedDate;

            lblOldDate.Text       = string.Format(lblOldDate.Text, toDate.Day, toDate.Month, toDate.Year);
            lblNewDate.Text       = string.Format(lblOldDate.Text, toDate.Day, toDate.Month, toDate.Year);
            lblOldDateFooter.Text = string.Format(lblOldDate.Text, toDate.Day, toDate.Month, toDate.Year);
            lblNewDateFooter.Text = string.Format(lblOldDate.Text, toDate.Day, toDate.Month, toDate.Year);

            // get organization
            var people = hr_RecordServices.GetById(recordId);

            if (people == null)
            {
                return;
            }

            lblFullName.Text     = people.FullName;
            lblEmployeeCode.Text = people.EmployeeCode;

            var table = SQLHelper.ExecuteTable(
                SQLManagementAdapter.GetStore_PaperRequestTransfer(recordId, type, fromDate, endDate));

            DataSource = table;

            xrTableCellOldPosition.DataBindings.Add("Text", DataSource, "OldPosition");
            xrTableCellOldSalary.DataBindings.Add("Text", DataSource, "OldSalary");
            xrTableCellOldEffectiveDate.DataBindings.Add("Text", DataSource, "OldEffectiveDate", "{0:dd/MM/yyyy}");
            xrTableCellNewPosition.DataBindings.Add("Text", DataSource, "NewPosition");
            xrTableCellNewSalary.DataBindings.Add("Text", DataSource, "NewSalary");
            xrTableCellNewEffectiveDate.DataBindings.Add("Text", DataSource, "NewEffectiveDate", "{0:dd/MM/yyyy}");
        }