From 4c1e887c06209ac49528f16d67c2e63cd1b25114 Mon Sep 17 00:00:00 2001 From: FLARJ <122087628+FLARJ@users.noreply.github.com> Date: Sat, 8 Apr 2023 23:26:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=D1=81=D0=BB=D0=BE=D0=B4=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9=20=D0=B8=20=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B8=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=20=D0=B2=20=D0=BE=D1=84=D0=B8?= =?UTF-8?q?=D1=81=D0=BD=D1=8B=D1=85=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToPdfManager.cs | 1 - .../ExcelStyleInfoType.cs | 0 .../HelperEnums/PdfRowParameters.cs | 18 ------------------ .../HelperModels/ExcelInfoManager.cs | 12 ++---------- .../HelperModels/ExcelMergeParameters.cs | 2 +- .../Implements/SaveToExcelManager.cs | 5 ++--- .../Implements/SaveToPdfManager.cs | 7 +++---- .../Implements/SaveToWordManager.cs | 2 +- 8 files changed, 9 insertions(+), 38 deletions(-) rename FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/{HelperModels => HelperEnums}/ExcelStyleInfoType.cs (100%) delete mode 100644 FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/PdfRowParameters.cs diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/AbstractSaveToPdfManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/AbstractSaveToPdfManager.cs index 7c6a9d7..d622635 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/AbstractSaveToPdfManager.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/AbstractSaveToPdfManager.cs @@ -14,7 +14,6 @@ namespace FurnitureFactoryBusinessLogic.OfficePackage.Implements { CreatePdf(info); CreateParagraph(new PdfParagraph { Text = info.Title, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); - CreateParagraph(new PdfParagraph { Text = $"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center }); CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "3cm", "6cm", "6cm" }); diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelStyleInfoType.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs similarity index 100% rename from FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelStyleInfoType.cs rename to FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/PdfRowParameters.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/PdfRowParameters.cs deleted file mode 100644 index 9ee1517..0000000 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperEnums/PdfRowParameters.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FurnitureFactoryBusinessLogic.OfficePackage.HelperEnums; - -namespace FurnitureFactoryBusinessLogic.OfficePackage.HelperEnums -{ - internal class PdfRowParameters - { - public List Texts { get; set; } = new(); - - public string Style { get; set; } = string.Empty; - - public PdfParagraphAlignmentType ParagraphAlignment { get; set; } - } -} diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs index 4ac90a4..7483680 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs @@ -1,13 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using FurnitureContracts.ViewModel; -using FurnitureFactoryDataModels.Models; -using System; -using System.Collections.Generic; -using System.ComponentModel; +using FurnitureContracts.ViewModel; + namespace FurnitureFactoryBusinessLogic.OfficePackage.HelperModels { diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs index 92fe18f..b6150b2 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace FurnitureFactoryBusinessLogic.OfficePackage.HelperEnums { - public class ExcelMergeParameters + public enum ExcelMergeParameters { public string CellFromName { get; set; } = string.Empty; diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToExcelManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToExcelManager.cs index be28ea4..c6c4621 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToExcelManager.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToExcelManager.cs @@ -1,16 +1,16 @@ using FurnitureFactoryBusinessLogic.OfficePackage.HelperEnums; using FurnitureFactoryBusinessLogic.OfficePackage.HelperModels; -using static System.Net.Mime.MediaTypeNames; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Office2010.Excel; using DocumentFormat.OpenXml.Office2013.Excel; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Spreadsheet; +using MediaTypeNames = System.Net.Mime.MediaTypeNames; namespace FurnitureFactoryBusinessLogic.OfficePackage.Implements { - public class SaveToExcelManager + public class SaveToExcelManager : AbstractSaveToExcelManager { private SpreadsheetDocument? _spreadsheetDocument; @@ -161,7 +161,6 @@ namespace FurnitureFactoryBusinessLogic.OfficePackage.Implements CreateStyles(workbookpart); - _shareStringPart = _spreadsheetDocument.WorkbookPart!.GetPartsOfType().Any() ? _spreadsheetDocument.WorkbookPart.GetPartsOfType().First() : _spreadsheetDocument.WorkbookPart.AddNewPart(); diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToPdfManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToPdfManager.cs index 9b31dd1..07a5258 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToPdfManager.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToPdfManager.cs @@ -9,14 +9,13 @@ using System.Threading.Tasks; using FurnitureFactoryBusinessLogic.OfficePackage.HelperModels; using static System.Net.Mime.MediaTypeNames; using DocumentFormat.OpenXml; -using DocumentFormat.OpenXml.Office2010.Excel; -using DocumentFormat.OpenXml.Office2013.Excel; using DocumentFormat.OpenXml.Packaging; -using DocumentFormat.OpenXml.Spreadsheet; +using MigraDoc.DocumentObjectModel.Tables; + namespace FurnitureFactoryBusinessLogic.OfficePackage.Implements { - public class SaveToPdfManager + public class SaveToPdfManager : AbstractSaveToPdfManager { private Document? _document; diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToWordManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToWordManager.cs index 4e6b12c..39693ee 100644 --- a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToWordManager.cs +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/Implements/SaveToWordManager.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; namespace FurnitureFactoryBusinessLogic.OfficePackage.Implements { - public class SaveToWordManager + public class SaveToWordManager : AbstractSaveToWordManager { private WordprocessingDocument? _wordDocument;