From 1ab91e7b6371ff1b7c006bbc64bbbbf93403c1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Tue, 28 May 2024 00:45:32 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=BE=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D0=B0=D0=B1?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BD=D1=8B=D0=B9=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D0=B2=D0=BE=D1=80=D0=B4=20=D0=BA=D1=83?= =?UTF-8?q?=D1=80=D1=81=D0=BE=D0=B2=20=D0=BF=D0=BE=20=D1=80=D0=B5=D1=86?= =?UTF-8?q?=D0=B5=D0=BF=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractSaveToWordCoursesByProcedures.cs | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Polyclinic/PolyclinicBusinessLogic/OfficePackage/AbstractSaveToWordCoursesByProcedures.cs diff --git a/Polyclinic/PolyclinicBusinessLogic/OfficePackage/AbstractSaveToWordCoursesByProcedures.cs b/Polyclinic/PolyclinicBusinessLogic/OfficePackage/AbstractSaveToWordCoursesByProcedures.cs new file mode 100644 index 0000000..7fc2e1b --- /dev/null +++ b/Polyclinic/PolyclinicBusinessLogic/OfficePackage/AbstractSaveToWordCoursesByProcedures.cs @@ -0,0 +1,63 @@ +using PolyclinicBusinessLogic.OfficePackage.HelperEnums; +using PolyclinicBusinessLogic.OfficePackage.HelperModels.Word; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PolyclinicBusinessLogic.OfficePackage +{ + public abstract class AbstractSaveToWordCoursesByProcedures + { + public void CreateDoc(WordCoursesByProceduresInfo info) + { + CreateWord(info); + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> + { + (info.Title, new WordTextProperties { Bold = true, Size = "24", }) + }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Center + } + }); + foreach (var course in info.Courses) + { + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { + (sushi.SushiName, new WordTextProperties { Bold = true, Size = "24", }), + (" цена: " + sushi.Price.ToString() + " рублей", new WordTextProperties { Size = "24", }) + }, + + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } + SaveWord(info); + } + /// + /// Создание doc-файла + /// + /// + protected abstract void CreateWord(WordCoursesByProceduresInfo info); + /// + /// Создание абзаца с текстом + /// + /// + /// + protected abstract void CreateParagraph(WordParagraph paragraph); + /// + /// Сохранение файла + /// + /// + protected abstract void SaveWord(WordCoursesByProceduresInfo info); + } +}