поручитель отчеты че то

This commit is contained in:
antoc0der 2024-05-02 10:46:04 +04:00
parent 963a69afc3
commit 62f847e5f6
8 changed files with 115 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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
}
}

View File

@ -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; }
}
}

View File

@ -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<ReportPurchaseMedicationViewModel> PurchaseMedications { get; set; } = new();
}
}

View File

@ -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}";
}
}

View File

@ -15,8 +15,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="OfficePackage\HelperEnums\" />
<Folder Include="OfficePackage\HelperModels\" />
<Folder Include="OfficePackage\Implements\" />
</ItemGroup>
</Project>

View File

@ -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
{
}
}

View File

@ -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<Tuple<string, int>> Components { get; set; } = new();
}
}