diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs index fe10999..b57bf8a 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs @@ -39,8 +39,8 @@ this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.списокКомонентовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.компонентыПоИзделиямToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FurnituresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.FurnituresComponentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.menuStrip1.SuspendLayout(); @@ -142,26 +142,26 @@ // отчетыToolStripMenuItem // this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.списокКомонентовToolStripMenuItem, - this.компонентыПоИзделиямToolStripMenuItem, + this.FurnituresToolStripMenuItem, + this.FurnituresComponentsToolStripMenuItem, this.списокЗаказовToolStripMenuItem}); this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(60, 20); this.отчетыToolStripMenuItem.Text = "Отчеты"; // - // списокКомонентовToolStripMenuItem + // FurnituresToolStripMenuItem // - this.списокКомонентовToolStripMenuItem.Name = "списокКомонентовToolStripMenuItem"; - this.списокКомонентовToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.списокКомонентовToolStripMenuItem.Text = "Список комонентов"; - this.списокКомонентовToolStripMenuItem.Click += new System.EventHandler(this.ComponentsToolStripMenuItem_Click); + this.FurnituresToolStripMenuItem.Name = "FurnituresToolStripMenuItem"; + this.FurnituresToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.FurnituresToolStripMenuItem.Text = "Список изделий"; + this.FurnituresToolStripMenuItem.Click += new System.EventHandler(this.FurnituresToolStripMenuItem_Click); // - // компонентыПоИзделиямToolStripMenuItem + // FurnituresComponentsToolStripMenuItem // - this.компонентыПоИзделиямToolStripMenuItem.Name = "компонентыПоИзделиямToolStripMenuItem"; - this.компонентыПоИзделиямToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.компонентыПоИзделиямToolStripMenuItem.Text = "Компоненты по изделиям"; - this.компонентыПоИзделиямToolStripMenuItem.Click += new System.EventHandler(this.ComponentProductsToolStripMenuItem_Click); + this.FurnituresComponentsToolStripMenuItem.Name = "FurnituresComponentsToolStripMenuItem"; + this.FurnituresComponentsToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.FurnituresComponentsToolStripMenuItem.Text = "Изделия по компонентам"; + this.FurnituresComponentsToolStripMenuItem.Click += new System.EventHandler(this.FurnitureComponentsToolStripMenuItem_Click); // // списокЗаказовToolStripMenuItem // @@ -207,8 +207,8 @@ private ToolStripMenuItem компонентыToolStripMenuItem; private ToolStripMenuItem изделияToolStripMenuItem; private ToolStripMenuItem отчетыToolStripMenuItem; - private ToolStripMenuItem списокКомонентовToolStripMenuItem; - private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem; + private ToolStripMenuItem FurnituresToolStripMenuItem; + private ToolStripMenuItem FurnituresComponentsToolStripMenuItem; private ToolStripMenuItem списокЗаказовToolStripMenuItem; } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.cs index e4d50f1..6657a63 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.cs @@ -1,7 +1,6 @@ using FurnitureAssemblyBusinessLogic; using FurnitureAssemblyContracts.BindingModels; using FurnitureAssemblyContracts.BusinessLogicsContarcts; -using FurnitureAssemblyDataModels.Enums; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -158,13 +157,13 @@ namespace FurnitureAssembly LoadData(); } - private void ComponentsToolStripMenuItem_Click(object sender, EventArgs + private void FurnituresToolStripMenuItem_Click(object sender, EventArgs e) { using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; if (dialog.ShowDialog() == DialogResult.OK) { - _reportLogic.SaveComponentsToWordFile(new ReportBindingModel + _reportLogic.SaveFurnituresToWordFile(new ReportBindingModel { FileName = dialog.FileName }); @@ -172,7 +171,7 @@ namespace FurnitureAssembly MessageBoxIcon.Information); } } - private void ComponentProductsToolStripMenuItem_Click(object sender, + private void FurnitureComponentsToolStripMenuItem_Click(object sender, EventArgs e) { var service = diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 6bcd3f9..f4f1705 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -18,17 +18,18 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage JustificationType = WordJustificationType.Center } }); - foreach (var component in info.Components) + foreach (var furniture in info.Furnitures) { CreateParagraph(new WordParagraph { - Texts = new List<(string, WordTextProperties)> { (component.ComponentName, new WordTextProperties { Size = "24", }) }, + Texts = new List<(string, WordTextProperties)> { (furniture.FurnitureName, new WordTextProperties { Size = "24", Bold=true}), (" - " + furniture.Price.ToString(), new WordTextProperties { Size = "24", }) }, TextProperties = new WordTextProperties { Size = "24", JustificationType = WordJustificationType.Both } }); + } SaveWord(info); } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index ddd7389..73ebd4d 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -6,6 +6,6 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List Components { get; set; } = new(); + public List Furnitures { get; set; } = new(); } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs index d222422..609c1e0 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs @@ -16,15 +16,15 @@ namespace FurnitureAssemblyBusinessLogic public class ReportLogic : IReportLogic { private readonly IComponentStorage _componentStorage; - private readonly IFurnitureStorage _productStorage; + private readonly IFurnitureStorage _furnitureStorage; private readonly IOrderStorage _orderStorage; private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; - public ReportLogic(IFurnitureStorage productStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, + public ReportLogic(IFurnitureStorage furnitureStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { - _productStorage = productStorage; + _furnitureStorage = furnitureStorage; _componentStorage = componentStorage; _orderStorage = orderStorage; _saveToExcel = saveToExcel; @@ -38,7 +38,7 @@ namespace FurnitureAssemblyBusinessLogic public List GetFurnitureComponent() { var components = _componentStorage.GetFullList(); - var products = _productStorage.GetFullList(); + var products = _furnitureStorage.GetFullList(); var list = new List(); foreach (var component in components) { @@ -86,13 +86,13 @@ namespace FurnitureAssemblyBusinessLogic /// Сохранение компонент в файл-Word /// /// - public void SaveComponentsToWordFile(ReportBindingModel model) + public void SaveFurnituresToWordFile(ReportBindingModel model) { _saveToWord.CreateDoc(new WordInfo { FileName = model.FileName, - Title = "Список компонент", - Components = _componentStorage.GetFullList() + Title = "Список изделий", + Furnitures = _furnitureStorage.GetFullList() }); } /// diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs index de1d8f3..45ec909 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs @@ -20,7 +20,7 @@ namespace FurnitureAssemblyContracts.BusinessLogicsContarcts /// Сохранение компонент в файл-Word /// /// - void SaveComponentsToWordFile(ReportBindingModel model); + void SaveFurnituresToWordFile(ReportBindingModel model); /// /// Сохранение компонент с указаеним продуктов в файл-Excel ///