From 25fc7088590328bbf9905d46b02c890ddc920850 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 15 Mar 2023 19:58:55 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B2=D1=81=D0=BF=D0=BE=D0=BC=D0=BE=D0=B3=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D1=91=D1=82=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HelperEnums/ExcelStyleInfoType.cs | 21 ++++++++++++++ .../HelperEnums/PdfParagraphAligmentType.cs | 21 ++++++++++++++ .../HelperEnums/WordJustificationType.cs | 18 ++++++++++++ .../HelperModels/ExcelCellParameters.cs | 28 +++++++++++++++++++ .../OfficePackage/HelperModels/ExcelInfo.cs | 22 +++++++++++++++ .../HelperModels/ExcelMergeParametrs.cs | 19 +++++++++++++ .../OfficePackage/HelperModels/PdfInfo.cs | 24 ++++++++++++++++ .../HelperModels/PdfParagraph.cs | 20 +++++++++++++ .../HelperModels/PdfRowParametrs.cs | 22 +++++++++++++++ .../OfficePackage/HelperModels/WordInfo.cs | 20 +++++++++++++ .../HelperModels/WordParagraph.cs | 18 ++++++++++++ .../HelperModels/WordTextProperties.cs | 22 +++++++++++++++ .../ViewModels/ReportOrdersViewModel.cs | 2 +- 13 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAligmentType.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelMergeParametrs.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfRowParametrs.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs new file mode 100644 index 0000000..851b205 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums +{ + //вспомогательное перечисление для оформления exel + public enum ExcelStyleInfoType + { + //заголовок + Title, + + //просто текст + Text, + + //текст в рамке + TixtWithBorder + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAligmentType.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAligmentType.cs new file mode 100644 index 0000000..e7627f1 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAligmentType.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums +{ + //вспомогательное перечисление для оформления pdf документа + public enum PdfParagraphAligmentType + { + //либо по центру + Center, + + //либо с левого края + Left, + + //либо с правого края + Right + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs new file mode 100644 index 0000000..b495c5f --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums +{ + //вспомогательное перечисление для настройки формата word документа + public enum WordJustificationType + { + //выравниваем либо по центру + Center, + + //либо на всю ширину + Both + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs new file mode 100644 index 0000000..2ab2304 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs @@ -0,0 +1,28 @@ +using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //информация по ячейке в таблице excel + public class ExcelCellParameters + { + //название колонки + public string ColumnName { get; set; } = string.Empty; + + //строка + public uint RowIndex { get; set; } + + //тект в ячейке + public string Text { get; set; } = string.Empty; + + //геттер для того, чтобы не искать каждый раз + public string CallReference => $"{ColumnName}{RowIndex}"; + + //в каком стиле выводить информацию + public ExcelStyleInfoType StyleInfo { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs new file mode 100644 index 0000000..8d61471 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -0,0 +1,22 @@ +using BlacksmithWorkshopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //информация по excel файлу, который хотим создать + public class ExcelInfo + { + //название файла + public string FileName { get; set; } = string.Empty; + + //заголовок + public string Title { get; set; } = string.Empty; + + //список заготовок по изделиям + public List ManufactureWorkPieces { get; set; } = new(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelMergeParametrs.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelMergeParametrs.cs new file mode 100644 index 0000000..c39988a --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/ExcelMergeParametrs.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //информация для объединения ячеек + public class ExcelMergeParametrs + { + public string CellFromName { get; set; } = string.Empty; + + public string CellToName { get; set; } = string.Empty; + + //гетер для указания диапазона для объединения, чтобы каждый раз его не вычислять + public string Marge => $"{CellFromName}:{CellToName}"; + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs new file mode 100644 index 0000000..8c8ed78 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs @@ -0,0 +1,24 @@ +using BlacksmithWorkshopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //общая информация по pdf файлу + public class PdfInfo + { + public string FileName { get; set; } = string.Empty; + + public string Title { get; set; } = string.Empty; + + public DateTime DateFrom { get; set; } + + public DateTime DateTo { get; set; } + + //перечень заказов за указанный период для вывода/сохранения + public List Orders { get; set; } = new(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs new file mode 100644 index 0000000..e7e51ad --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs @@ -0,0 +1,20 @@ +using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //информация п параграфу в pdf документе + public class PdfParagraph + { + public string Text { get; set; } = string.Empty; + + public string Style { get; set; } = string.Empty; + + //информация по выравниванию текста в параграфе + public PdfParagraphAligmentType ParagraphAligment { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfRowParametrs.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfRowParametrs.cs new file mode 100644 index 0000000..1b1dfb4 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/PdfRowParametrs.cs @@ -0,0 +1,22 @@ +using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //информация по параметрам строк таблицы + public class PdfRowParametrs + { + //набор текстов + public List Texts { get; set; } = new(); + + //стиль к текстам + public string Style { get; set; } = string.Empty; + + //как выравниваем + public PdfParagraphAligmentType ParagraphAligment { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs new file mode 100644 index 0000000..90fa064 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -0,0 +1,20 @@ +using BlacksmithWorkshopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //общая информация по документу + public class WordInfo + { + public string FileName { get; set; } = string.Empty; + + public string Title { get; set; } = string.Empty; + + //список заготовок для вывода и сохранения + public List WorkPieces { get; set; } = new(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs new file mode 100644 index 0000000..79ed022 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //модель параграфов, которые есть в тексте + public class WordParagraph + { + //набор текстов в абзаце (для случая, если в абзаце текст разных стилей) + public List<(string, WordParagraph)> Texts { get; set; } = new(); + + //свойства параграфа, если они есть + public WordTextProperties? TextProperties { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs new file mode 100644 index 0000000..a808862 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs @@ -0,0 +1,22 @@ +using BlacksmithWorkshopBusinessLogic.OfficePackage.HelperEnums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.OfficePackage.HelperModels +{ + //модель свойств текста, которые нам нужны в word документе + public class WordTextProperties + { + //размере текста + public string Size { get; set; } = string.Empty; + + //надо ли делать его жирным + public bool Bold { get; set; } + + //выравнивание + public WordJustificationType JustificationType { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs index a38241b..d0e327d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs @@ -12,7 +12,7 @@ namespace BlacksmithWorkshopContracts.ViewModels public DateTime DateCreate { get; set; } - public string ProductName { get; set; } = string.Empty; + public string ManufactureName { get; set; } = string.Empty; public double Sum { get; set; } }