From 6d603ebb144b960657aac6c396cc8a59575b9573 Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Fri, 10 May 2024 21:54:34 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToExcel.cs | 8 ++++---- .../OfficePackage/HelperModels/WordParagraph.cs | 4 ++-- .../OfficePackage/Implements/SaveToExcel.cs | 2 +- .../OfficePackage/Implements/SaveToWord.cs | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 7ea4319..3dc42a9 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -31,19 +31,19 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage uint rowIndex = 2; - foreach (var mwp in info.FurnitureWorkPieces) + foreach (var fwp in info.FurnitureWorkPieces) { InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "A", RowIndex = rowIndex, - Text = mwp.FurnitureName, + Text = fwp.FurnitureName, StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; - foreach (var (WorkPiece, Count) in mwp.WorkPieces) + foreach (var (WorkPiece, Count) in fwp.WorkPieces) { InsertCellInWorksheet(new ExcelCellParameters { @@ -76,7 +76,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage { ColumnName = "C", RowIndex = rowIndex, - Text = mwp.TotalCount.ToString(), + Text = fwp.TotalCount.ToString(), StyleInfo = ExcelStyleInfoType.Text }); diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs index 03820a4..9e469a1 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs @@ -9,10 +9,10 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels // Модель параграфов, которые есть в тексте public class WordParagraph { - //набор текстов в абзаце (для случая, если в абзаце текст разных стилей) + // Набор текстов в абзаце (для случая, если в абзаце текст разных стилей) public List<(string, WordTextProperties)> Texts { get; set; } = new(); - //свойства параграфа, если они есть + // Свойства параграфа, если они есть public WordTextProperties? TextProperties { get; set; } public List> RowTexts { get; set; } = new(); diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs index ef01dba..1e38296 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs @@ -310,7 +310,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements else { // Все ячейки должны быть последовательно друг за другом расположены - // нужно определить, после какой вставлять + // Нужно определить, после какой вставлять Cell? refCell = null; foreach (Cell rowCell in row.Elements()) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 9f36f75..933cbe0 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -114,6 +114,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements var docRun = new Run(); var properties = new RunProperties(); + // Задание свойств текста - размер и жирность properties.AppendChild(new FontSize { Val = run.Item2.Size }); if (run.Item2.Bold)