From e37e94a14f2e3d535e60b6e2cda06f6a477bc677 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Sun, 24 Mar 2024 22:07:47 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D0=B9=20=D0=B2=20word?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ReportLogic.cs | 6 +++--- .../OfficePackage/AbstractSaveToWord.cs | 7 +++++-- .../OfficePackage/HelperModels/WordInfo.cs | 2 +- .../BusinessLogicsContracts/IReportLogic.cs | 2 +- SecuritySystem/SecuritySystemView/FormMain.Designer.cs | 4 ++-- SecuritySystem/SecuritySystemView/FormMain.cs | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs b/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs index 68b65ec..51ec67b 100644 --- a/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ReportLogic.cs @@ -79,13 +79,13 @@ namespace SecuritySystemBusinessLogic.BusinessLogics /// Сохранение компонент в файл-Word /// /// - public void SaveComponentsToWordFile(ReportBindingModel model) + public void SaveSecuresToWordFile(ReportBindingModel model) { _saveToWord.CreateDoc(new WordInfo { FileName = model.FileName, - Title = "Список компонент", - Components = _componentStorage.GetFullList() + Title = "Список изделий", + Secures = _secureStorage.GetFullList() }); } /// diff --git a/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 51279f1..39b624e 100644 --- a/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -17,11 +17,14 @@ namespace SecuritySystemBusinessLogic.OfficePackage JustificationType = WordJustificationType.Center } }); - foreach (var component in info.Components) + foreach (var secure in info.Secures) { CreateParagraph(new WordParagraph { - Texts = new List<(string, WordTextProperties)> { (component.ComponentName, new WordTextProperties { Size = "24", }) }, + Texts = new List<(string, WordTextProperties)> { + (secure.SecureName, new WordTextProperties { Bold = true, Size = "24", }), + ("\t" + secure.Price.ToString() + " руб.", new WordTextProperties { Size = "24", }) + }, TextProperties = new WordTextProperties { Size = "24", diff --git a/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index 029c1cd..05c8ce6 100644 --- a/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/SecuritySystem/SecuritySystemBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -6,6 +6,6 @@ namespace SecuritySystemBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List Components { get; set; } = new(); + public List Secures { get; set; } = new(); } } diff --git a/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IReportLogic.cs b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IReportLogic.cs index 4413448..36fce98 100644 --- a/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IReportLogic.cs +++ b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IReportLogic.cs @@ -20,7 +20,7 @@ namespace SecuritySystemContracts.BusinessLogicsContracts /// Сохранение компонент в файл-Word /// /// - void SaveComponentsToWordFile(ReportBindingModel model); + void SaveSecuresToWordFile(ReportBindingModel model); /// /// Сохранение компонент с указаеним продуктов в файл-Excel /// diff --git a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs index f7557b2..8388aca 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs @@ -88,8 +88,8 @@ // списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; списокКомпонентовToolStripMenuItem.Size = new Size(276, 26); - списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; - списокКомпонентовToolStripMenuItem.Click += ReportComponentsToolStripMenuItem_Click; + списокКомпонентовToolStripMenuItem.Text = "Список изделий"; + списокКомпонентовToolStripMenuItem.Click += ReportSecuresToolStripMenuItem_Click; // // компонентыПоИзделиямToolStripMenuItem // diff --git a/SecuritySystem/SecuritySystemView/FormMain.cs b/SecuritySystem/SecuritySystemView/FormMain.cs index db1d737..a9b220c 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.cs @@ -140,12 +140,12 @@ namespace SecuritySystemView LoadData(); } - private void ReportComponentsToolStripMenuItem_Click(object sender, EventArgs e) + private void ReportSecuresToolStripMenuItem_Click(object sender, EventArgs e) { using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; if (dialog.ShowDialog() == DialogResult.OK) { - _reportLogic.SaveComponentsToWordFile(new ReportBindingModel + _reportLogic.SaveSecuresToWordFile(new ReportBindingModel { FileName = dialog.FileName });