diff --git a/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs new file mode 100644 index 0000000..fd77389 --- /dev/null +++ b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryBusinessLogic.OfficePackage.HelperModels; + +namespace VeterinaryBusinessLogic.OfficePackage +{ + public abstract class AbstractSaveToExcel + { + /// Создание excel-файла + protected abstract void CreateExcel(ExcelInfo info); + + /// Добавляем новую ячейку в лист + protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams); + + /// Объединение ячеек + protected abstract void MergeCells(ExcelMergeParameters excelParams); + + /// Сохранение файла + protected abstract void SaveExcel(ExcelInfo info); + } +} diff --git a/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs new file mode 100644 index 0000000..e9e76fe --- /dev/null +++ b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryBusinessLogic.OfficePackage.HelperEnums +{ + public enum ExcelStyleInfoType + { + Title, + Text, + TextWithBroder + } +} diff --git a/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs new file mode 100644 index 0000000..f418e88 --- /dev/null +++ b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VeterinaryBusinessLogic.OfficePackage.HelperEnums; + +namespace VeterinaryBusinessLogic.OfficePackage.HelperModels +{ + public class ExcelCellParameters + { + public string ColumnName { get; set; } = string.Empty; + public uint RowIndex { get; set; } + public string Text { get; set; } = string.Empty; + public string CellReference => $"{ColumnName}{RowIndex}"; + public ExcelStyleInfoType StyleInfo { get; set; } + } +} diff --git a/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs new file mode 100644 index 0000000..d4bd360 --- /dev/null +++ b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryBusinessLogic.OfficePackage.HelperModels +{ + public class ExcelInfo + { + public string FileName { get; set; } = string.Empty; + public string Title { get; set; } = string.Empty; + public List PurchaseMedications { get; set; } = new(); + } +} diff --git a/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs new file mode 100644 index 0000000..c15779e --- /dev/null +++ b/VeterinaryView/VeterinaryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryBusinessLogic.OfficePackage.HelperModels +{ + public class ExcelMergeParameters + { + public string CellFromName { get; set; } = string.Empty; + public string CellToName { get; set; } = string.Empty; + public string Merge => $"{CellFromName}:{CellToName}"; + } +} diff --git a/VeterinaryView/VeterinaryBusinessLogic/VeterinaryBusinessLogic.csproj b/VeterinaryView/VeterinaryBusinessLogic/VeterinaryBusinessLogic.csproj index 3110a4b..cb0a8ba 100644 --- a/VeterinaryView/VeterinaryBusinessLogic/VeterinaryBusinessLogic.csproj +++ b/VeterinaryView/VeterinaryBusinessLogic/VeterinaryBusinessLogic.csproj @@ -14,4 +14,8 @@ + + + + diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/BigReportViewModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/BigReportViewModel.cs new file mode 100644 index 0000000..67ad75a --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/BigReportViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.ViewModels +{ + internal class BigReportViewModel + { + } +} diff --git a/VeterinaryView/VeterinaryContracts/ViewModels/ReportPurchaseMedicationModel.cs b/VeterinaryView/VeterinaryContracts/ViewModels/ReportPurchaseMedicationModel.cs new file mode 100644 index 0000000..aee087a --- /dev/null +++ b/VeterinaryView/VeterinaryContracts/ViewModels/ReportPurchaseMedicationModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VeterinaryContracts.ViewModels +{ + public class ReportPurchaseMedicationModel + { + public string FlowerName { get; set; } = string.Empty; + public int TotalCount { get; set; } + public List> Components { get; set; } = new(); + } +}