2023-05-19 13:04:22 +04:00
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperEnums;
|
|
|
|
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperModels;
|
2023-05-19 20:11:24 +04:00
|
|
|
|
using BankYouBankruptDataModels.Enums;
|
2023-05-19 13:04:22 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BankYouBankruptBusinessLogic.OfficePackage
|
|
|
|
|
{
|
|
|
|
|
public abstract class AbstractSaveToExcel
|
|
|
|
|
{
|
|
|
|
|
//Создание отчета. Описание методов ниже
|
2023-05-19 23:32:09 +04:00
|
|
|
|
public void CreateReport(ExcelInfo info, OfficeOperationEnum operationEnum)
|
2023-05-19 13:04:22 +04:00
|
|
|
|
{
|
2023-05-19 23:32:09 +04:00
|
|
|
|
if(operationEnum == OfficeOperationEnum.Между_cчетами)
|
2023-05-19 20:11:24 +04:00
|
|
|
|
{
|
|
|
|
|
CreateMoneyTransferExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 23:32:09 +04:00
|
|
|
|
if (operationEnum == OfficeOperationEnum.Пополнение_карт)
|
2023-05-19 20:11:24 +04:00
|
|
|
|
{
|
|
|
|
|
CreateCreditingExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 23:32:09 +04:00
|
|
|
|
if (operationEnum == OfficeOperationEnum.Cнятие_с_карты)
|
2023-05-19 20:11:24 +04:00
|
|
|
|
{
|
|
|
|
|
CreateDebitingExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 23:32:09 +04:00
|
|
|
|
if (operationEnum == OfficeOperationEnum.Для_кассира)
|
2023-05-19 20:11:24 +04:00
|
|
|
|
{
|
|
|
|
|
CreateCashierExcel(info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CreateMoneyTransferExcel(ExcelInfo info)
|
|
|
|
|
{
|
|
|
|
|
CreateExcel(info);
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
|
|
|
|
//вставляет заголовок
|
2023-05-19 20:11:24 +04:00
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = 1,
|
|
|
|
|
Text = info.Title,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Title
|
|
|
|
|
});
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
|
|
|
|
//соединяет 3 ячейки для заголовка
|
2023-05-19 20:11:24 +04:00
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A1",
|
|
|
|
|
CellToName = "C1"
|
|
|
|
|
});
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
|
|
|
|
//номер строчки в докуметне
|
2023-05-19 20:11:24 +04:00
|
|
|
|
uint rowIndex = 2;
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
|
|
|
|
foreach (var mt in info.MoneyTransfer)
|
|
|
|
|
{
|
|
|
|
|
//вставляет номер перевода
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 20:11:24 +04:00
|
|
|
|
Text = "Перевод №" + mt.Id,
|
2023-05-19 13:04:22 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Номер счёта отправителя: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = mt.AccountSenderNumber,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта получателя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Номер счёта получателя: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = mt.AccountPayeeNumber,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//Вставляет слово "Сумма перевода"
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Сумма перевода: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//подсчитывает общее кол-во заготовок в изделии
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = mt.Sum.ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
2023-05-19 23:32:09 +04:00
|
|
|
|
|
|
|
|
|
//Вставляет слово "Сумма перевода"
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Дата операции: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//подсчитывает общее кол-во заготовок в изделии
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = mt.DateOperation.ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
2023-05-19 13:04:22 +04:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-19 20:11:24 +04:00
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Суммарный объём переводов: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A" + rowIndex.ToString(),
|
|
|
|
|
CellToName = "B" + rowIndex.ToString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = info.MoneyTransfer.Sum(x => x.Sum).ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SaveExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CreateCreditingExcel(ExcelInfo info)
|
|
|
|
|
{
|
|
|
|
|
CreateExcel(info);
|
|
|
|
|
|
|
|
|
|
//вставляет заголовок
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = 1,
|
|
|
|
|
Text = info.Title,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Title
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//соединяет 3 ячейки для заголовка
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A1",
|
|
|
|
|
CellToName = "E2"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//номер строчки в докуметне
|
|
|
|
|
uint rowIndex = 3;
|
|
|
|
|
|
|
|
|
|
foreach (var cr in info.Crediting)
|
|
|
|
|
{
|
|
|
|
|
//вставляет номер перевода
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Пополнение №" + cr.Id,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Номер карты: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = cr.CardNumber,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта получателя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Сумма пополнения: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = cr.Sum.ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Суммарный объём пополнений: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A" + rowIndex.ToString(),
|
|
|
|
|
CellToName = "B" + rowIndex.ToString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = info.Crediting.Sum(x => x.Sum).ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SaveExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CreateDebitingExcel(ExcelInfo info)
|
|
|
|
|
{
|
|
|
|
|
CreateExcel(info);
|
|
|
|
|
|
|
|
|
|
//вставляет заголовок
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = 1,
|
|
|
|
|
Text = info.Title,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Title
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//соединяет 3 ячейки для заголовка
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A1",
|
|
|
|
|
CellToName = "E2"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//номер строчки в докуметне
|
|
|
|
|
uint rowIndex = 3;
|
|
|
|
|
|
|
|
|
|
foreach (var cr in info.Debiting)
|
|
|
|
|
{
|
|
|
|
|
//вставляет номер перевода
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Снятие №" + cr.Id,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Номер карты: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = cr.CardNumber,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта получателя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Сумма снятия: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = cr.Sum.ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Суммарный объём снятий: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A" + rowIndex.ToString(),
|
|
|
|
|
CellToName = "B" + rowIndex.ToString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 20:32:27 +04:00
|
|
|
|
Text = info.Debiting.Sum(x => x.Sum).ToString(),
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
SaveExcel(info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CreateCashierExcel(ExcelInfo info)
|
|
|
|
|
{
|
|
|
|
|
CreateExcel(info);
|
|
|
|
|
|
|
|
|
|
//вставляет заголовок
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = 1,
|
|
|
|
|
Text = info.Title,
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Title
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//соединяет 3 ячейки для заголовка
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A1",
|
|
|
|
|
CellToName = "E2"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//номер строчки в докуметне
|
|
|
|
|
uint rowIndex = 3;
|
|
|
|
|
|
|
|
|
|
foreach (var cr in info.Debiting)
|
|
|
|
|
{
|
|
|
|
|
//вставляет номер перевода
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = "Заявка №" + cr.Id,
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
2023-05-19 21:05:26 +04:00
|
|
|
|
//строчка с номером счёта получателя
|
2023-05-19 20:11:24 +04:00
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = "Сумма заявки: ",
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
2023-05-19 21:05:26 +04:00
|
|
|
|
//вставка суммы заявки
|
2023-05-19 20:11:24 +04:00
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = cr.Sum.ToString(),
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
//строчка с номером счёта получателя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = "Статус: ",
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = cr.Status.ToString(),
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
2023-05-19 23:32:09 +04:00
|
|
|
|
|
|
|
|
|
//строчка с номером счёта получателя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "B",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Дата: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//вставка номера отправителя
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "C",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = cr.DateClose == null ? "В обработке" : cr.DateClose.ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.TextWithBorder
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
2023-05-19 20:11:24 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowIndex++;
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = "Суммарный объём открытых заявок на снятие: ",
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A" + rowIndex.ToString(),
|
2023-05-19 21:05:26 +04:00
|
|
|
|
CellToName = "C" + rowIndex.ToString()
|
2023-05-19 20:11:24 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
2023-05-19 21:05:26 +04:00
|
|
|
|
ColumnName = "D",
|
2023-05-19 20:11:24 +04:00
|
|
|
|
RowIndex = rowIndex,
|
2023-05-19 21:05:26 +04:00
|
|
|
|
Text = info.Debiting.Where(x => x.Status == StatusEnum.Открыта).Sum(x => x.Sum).ToString(),
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
rowIndex += 2;
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "A",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = "Суммарный объём закртытых заявок на снятие: ",
|
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
MergeCells(new ExcelMergeParameters
|
|
|
|
|
{
|
|
|
|
|
CellFromName = "A" + rowIndex.ToString(),
|
|
|
|
|
CellToName = "C" + rowIndex.ToString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
InsertCellInWorksheet(new ExcelCellParameters
|
|
|
|
|
{
|
|
|
|
|
ColumnName = "D",
|
|
|
|
|
RowIndex = rowIndex,
|
|
|
|
|
Text = info.Debiting.Where(x => x.Status == StatusEnum.Закрыта).Sum(x => x.Sum).ToString(),
|
2023-05-19 20:11:24 +04:00
|
|
|
|
StyleInfo = ExcelStyleInfoType.Text
|
|
|
|
|
});
|
|
|
|
|
|
2023-05-19 13:04:22 +04:00
|
|
|
|
SaveExcel(info);
|
2023-05-19 20:11:24 +04:00
|
|
|
|
}
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
2023-05-19 20:11:24 +04:00
|
|
|
|
//Создание excel-файла
|
|
|
|
|
protected abstract void CreateExcel(ExcelInfo info);
|
2023-05-19 13:04:22 +04:00
|
|
|
|
|
|
|
|
|
//Добавляем новую ячейку в лист
|
|
|
|
|
protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams);
|
|
|
|
|
|
|
|
|
|
//Объединение ячеек
|
|
|
|
|
protected abstract void MergeCells(ExcelMergeParameters excelParams);
|
|
|
|
|
|
|
|
|
|
//Сохранение файла
|
|
|
|
|
protected abstract void SaveExcel(ExcelInfo info);
|
|
|
|
|
}
|
|
|
|
|
}
|