Пример #1
0
        private void CreateDepartmentLabel(DepartmentSection dept)
        {
            var departmentCell = _worksheet.Cell(_currentRowIndex, _currentColumnIndex);

            departmentCell.Value = dept.Department.Name;
            departmentCell.Style.Font.FontSize = FontSize;
            departmentCell.Style.Font.Bold     = true;
        }
Пример #2
0
        private void CreateDepartmentLabel(DepartmentSection dec)
        {
            var deptLabel = _sheet.Cell(_currentRowIndex, 1);

            deptLabel.Value               = dec.Department.Name;
            deptLabel.DataType            = XLCellValues.Text;
            deptLabel.Style.Font.FontSize = FontSize;
            deptLabel.Style.Font.Bold     = true;
            _currentRowIndex++;
        }
Пример #3
0
        private void CreateDepartmentSection(DepartmentSection sec)
        {
            _currentRowIndex = _currentRowIndex + 2;
            CreateDepartmentLabel(sec);
            foreach (var bSection in sec.BankSections.Where(b => !b.IsTotalPerDay))
            {
                int initialRowInderForBorder = _currentRowIndex;
                CreateBankSection(bSection);
                CreateBorder(initialRowInderForBorder, _currentRowIndex);
                _currentRowIndex++;
            }

            CreateSubTotalTotal(sec);
        }
Пример #4
0
        private void CreateBanksPerDay(DepartmentSection dept)
        {
            foreach (var bank in dept.BankSections)
            {
                var bankCell = _worksheet.Cell(_currentRowIndex, _indexOfFirstColumn);
                bankCell.Value                      = bank.Bank.BankName;
                bankCell.DataType                   = XLCellValues.Text;
                bankCell.Style.Font.FontSize        = FontSize;
                bankCell.Style.Fill.BackgroundColor = XLColor.LightGray;

                var bankRange = _worksheet.Range(_currentRowIndex, _indexOfFirstColumn, _currentRowIndex,
                                                 _currentColumnIndex);
                bankRange.Merge();

                if (bank.IsTotalPerDay)
                {
                    bankRange.Style.Border.TopBorder     = XLBorderStyleValues.Medium;
                    bankRange.Style.Font.Bold            = true;
                    bankRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
                }
                else
                {
                    bankRange.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
                }

                _currentRowIndex++;

                CreateSubTotalRows(bank);
                _currentRowIndex++;
                CreateSettledAmountRow(bank);
                _currentRowIndex++;
                CreateForFundingAmountRow(bank);

                _indexOfLastRowBorder    = _currentRowIndex;
                _indexOfLastColumnBorder = _currentColumnIndex;


                _currentRowIndex = _currentRowIndex + 2;
            }
        }
Пример #5
0
        private void CreateSubTotalTotal(DepartmentSection sec)
        {
            _currentRowIndex = _currentRowIndex++;

            var subtotalLabel = _sheet.Cell(_currentRowIndex, 1);

            subtotalLabel.Value = "Sub Total";
            subtotalLabel.Style.Font.FontSize = FontSize;
            var totalAmount = _sheet.Cell(_currentRowIndex, 5);

            totalAmount.Value = sec.SubTotal;
            totalAmount.Style.NumberFormat.Format = "#,##0.00_);[Red](#,##0.00)";
            totalAmount.DataType            = XLCellValues.Number;
            totalAmount.Style.Font.FontSize = FontSize;

            _currentRowIndex++;
            var settledlabel = _sheet.Cell(_currentRowIndex, 1);

            settledlabel.Value = "Settled";
            settledlabel.Style.Font.FontSize = FontSize;
            var settledAmount = _sheet.Cell(_currentRowIndex, 5);

            settledAmount.Value = sec.SettledAmount;
            settledAmount.Style.NumberFormat.Format = "#,##0.00_);[Red](#,##0.00)";
            settledAmount.DataType            = XLCellValues.Number;
            settledAmount.Style.Font.FontSize = FontSize;

            _currentRowIndex++;
            var fundingLabel = _sheet.Cell(_currentRowIndex, 1);

            fundingLabel.Value = "For Funding";
            fundingLabel.Style.Font.FontSize = FontSize;
            var forFundingAmount = _sheet.Cell(_currentRowIndex, 5);

            forFundingAmount.Value = sec.RemainingAmount;
            forFundingAmount.Style.NumberFormat.Format = "#,##0.00_);[Red](#,##0.00)";
            forFundingAmount.DataType = XLCellValues.Number;
            forFundingAmount.Style.Border.TopBorder = XLBorderStyleValues.Thick;
            forFundingAmount.Style.Font.FontSize    = FontSize;
        }
Пример #6
0
 public DayTotal(DepartmentSection parentDepartment)
     : base(parentDepartment)
 {
     _parentDepartment = parentDepartment;
     IsTotalPerDay     = true;
 }