From 32635a6ebafd2a12f24a71e07f89b2344c608a7d Mon Sep 17 00:00:00 2001 From: dasha Date: Thu, 23 Mar 2023 16:41:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=90=20=D0=B5=D1=89=D0=B5=20=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D1=88=D0=B5=20=D1=82=D0=B0=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToWord.cs | 4 ++-- .../OfficePackage/HelperModels/WordRow.cs | 2 +- .../OfficePackage/Implements/SaveToWord.cs | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SushiBar/SushiBarBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/SushiBar/SushiBarBusinessLogic/OfficePackage/AbstractSaveToWord.cs index d493b56..85f1fb8 100644 --- a/SushiBar/SushiBarBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/SushiBar/SushiBarBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -55,7 +55,7 @@ namespace SushiBarBusinessLogic.OfficePackage List rows = new List(); rows.Add(new WordRow { - Texts = new List<(string, WordTextProperties)> { + Rows = new List<(string, WordTextProperties)> { ("Название", new WordTextProperties { Size = "24", Bold = true }), ("Адрес", new WordTextProperties { Size = "24", Bold = true }), ("Дата открытия", new WordTextProperties { Size = "24", Bold = true }) @@ -66,7 +66,7 @@ namespace SushiBarBusinessLogic.OfficePackage { rows.Add(new WordRow { - Texts = new List<(string, WordTextProperties)> { + Rows = new List<(string, WordTextProperties)> { (shop.ShopName, new WordTextProperties { Size = "24" }), (shop.Address, new WordTextProperties { Size = "24" }), (shop.DateOpening.ToShortDateString(), new WordTextProperties { Size = "24" }) diff --git a/SushiBar/SushiBarBusinessLogic/OfficePackage/HelperModels/WordRow.cs b/SushiBar/SushiBarBusinessLogic/OfficePackage/HelperModels/WordRow.cs index b283776..2b1be96 100644 --- a/SushiBar/SushiBarBusinessLogic/OfficePackage/HelperModels/WordRow.cs +++ b/SushiBar/SushiBarBusinessLogic/OfficePackage/HelperModels/WordRow.cs @@ -2,6 +2,6 @@ { public class WordRow { - public List<(string, WordTextProperties)> Texts { get; set; } = new(); + public List<(string, WordTextProperties)> Rows { get; set; } = new(); } } diff --git a/SushiBar/SushiBarBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/SushiBar/SushiBarBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 2eed47e..c28a7fc 100644 --- a/SushiBar/SushiBarBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/SushiBar/SushiBarBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -109,7 +109,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements tableProp.AppendChild(new TableWidth { Type = TableWidthUnitValues.Auto }); table.AppendChild(tableProp); TableGrid tableGrid = new TableGrid(); - for (int j = 0; j < data[0].Texts.Count; ++j) + for (int j = 0; j < data[0].Rows.Count; ++j) { tableGrid.AppendChild(new GridColumn() { Width = "3200" }); } @@ -117,21 +117,21 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements for (int i = 0; i < data.Count; ++i) { TableRow docRow = new TableRow(); - for (int j = 0; j < data[i].Texts.Count; ++j) + for (int j = 0; j < data[i].Rows.Count; ++j) { var docParagraph = new Paragraph(); var docRun = new Run(); var runProperties = new RunProperties(); - docParagraph.AppendChild(CreateParagraphProperties(data[i].Texts[j].Item2)); + docParagraph.AppendChild(CreateParagraphProperties(data[i].Rows[j].Item2)); runProperties.AppendChild(new RunFonts() { Ascii = "Times New Roman", ComplexScript = "Times New Roman", HighAnsi = "Times New Roman" }); - runProperties.AppendChild(new FontSize { Val = data[i].Texts[j].Item2.Size == null ? data[i].Texts[j].Item2.Size : "24" }); - if (data[i].Texts[j].Item2.Bold) + runProperties.AppendChild(new FontSize { Val = data[i].Rows[j].Item2.Size == null ? data[i].Rows[j].Item2.Size : "24" }); + if (data[i].Rows[j].Item2.Bold) runProperties.AppendChild(new Bold()); docRun.AppendChild(runProperties); - docRun.AppendChild(new Text { Text = data[i].Texts[j].Item1.ToString(), Space = SpaceProcessingModeValues.Preserve }); + docRun.AppendChild(new Text { Text = data[i].Rows[j].Item1.ToString(), Space = SpaceProcessingModeValues.Preserve }); docParagraph.AppendChild(docRun); TableCell docCell = new TableCell();