diff --git a/ClothShop/ClothShopBusinessLogic/BusinessLogics/ReportLogic.cs b/ClothShop/ClothShopBusinessLogic/BusinessLogics/ReportLogic.cs index 1cc0559..6b9757c 100644 --- a/ClothShop/ClothShopBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/ClothShop/ClothShopBusinessLogic/BusinessLogics/ReportLogic.cs @@ -83,13 +83,13 @@ namespace ClothShopBusinessLogic.BusinessLogics /// Сохранение компонент в файл-Word /// /// - public void SaveComponentsToWordFile(ReportBindingModel model) + public void SaveTextilesToWordFile(ReportBindingModel model) { _saveToWord.CreateDoc(new WordInfo { FileName = model.FileName, - Title = "Список компонентов", - Components = _componentStorage.GetFullList() + Title = "Список изделий", + Textiles = _textileStorage.GetFullList() }); } /// diff --git a/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index b88849c..65bff16 100644 --- a/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -39,23 +39,21 @@ namespace ClothShopBusinessLogic.OfficePackage StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; - foreach (var product in pc.Components) + foreach (var textile in pc.Components) { InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "B", RowIndex = rowIndex, - Text = product.Item1, - StyleInfo = - ExcelStyleInfoType.TextWithBroder + Text = textile.Item1, + StyleInfo = ExcelStyleInfoType.TextWithBroder }); InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "C", RowIndex = rowIndex, - Text = product.Item2.ToString(), - StyleInfo = - ExcelStyleInfoType.TextWithBroder + Text = textile.Item2.ToString(), + StyleInfo = ExcelStyleInfoType.TextWithBroder }); rowIndex++; } diff --git a/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs index a7ca0bf..7401d91 100644 --- a/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/ClothShop/ClothShopBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -14,6 +14,7 @@ namespace AbstractShopBusinessLogic.OfficePackage public void CreateDoc(WordInfo info) { CreateWord(info); + CreateParagraph(new WordParagraph { Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) }, @@ -23,12 +24,13 @@ namespace AbstractShopBusinessLogic.OfficePackage JustificationType = WordJustificationType.Center } }); - foreach (var component in info.Components) + + foreach (var engine in info.Textiles) { CreateParagraph(new WordParagraph { - Texts = new List<(string, WordTextProperties)> { -(component.ComponentName, new WordTextProperties { Size = "24", }) }, + Texts = new List<(string, WordTextProperties)> {(engine.TextileName + " - ", new WordTextProperties { Size = "24", Bold = true}), + (engine.Price.ToString(), new WordTextProperties { Size = "24", })}, TextProperties = new WordTextProperties { Size = "24", @@ -36,23 +38,27 @@ namespace AbstractShopBusinessLogic.OfficePackage } }); } + SaveWord(info); } + /// - /// Создание doc-файла - /// - /// + /// Создание doc-файла + /// + /// protected abstract void CreateWord(WordInfo info); + /// /// Создание абзаца с текстом /// /// /// protected abstract void CreateParagraph(WordParagraph paragraph); + /// - /// Сохранение файла - /// - /// + /// Сохранение файла + /// + /// protected abstract void SaveWord(WordInfo info); } } diff --git a/ClothShop/ClothShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/ClothShop/ClothShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index 87f559a..494a1c7 100644 --- a/ClothShop/ClothShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/ClothShop/ClothShopBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -11,6 +11,6 @@ namespace ClothShopBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List Components { get; set; } = new(); + public List Textiles { get; set; } = new(); } } diff --git a/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToExcel.cs b/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToExcel.cs index 8c6cd25..556b329 100644 --- a/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToExcel.cs +++ b/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToExcel.cs @@ -208,8 +208,7 @@ namespace ClothShopBusinessLogic.OfficePackage.Implements { ExcelStyleInfoType.Title => 2U, ExcelStyleInfoType.TextWithBroder => 1U, - ExcelStyleInfoType.Text => 0U, - _ => 0U, + ExcelStyleInfoType.Text => 0U, _ => 0U, }; } protected override void CreateExcel(ExcelInfo info) diff --git a/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 1146406..5a4fe38 100644 --- a/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/ClothShop/ClothShopBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -14,14 +14,15 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements public class SaveToWord : AbstractSaveToWord { private WordprocessingDocument? _wordDocument; + private Body? _docBody; + /// /// Получение типа выравнивания /// /// /// - private static JustificationValues - GetJustificationValues(WordJustificationType type) + private static JustificationValues GetJustificationValues(WordJustificationType type) { return type switch { @@ -30,6 +31,7 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements _ => JustificationValues.Left, }; } + /// /// Настройки страницы /// @@ -37,56 +39,61 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements private static SectionProperties CreateSectionProperties() { var properties = new SectionProperties(); + var pageSize = new PageSize { Orient = PageOrientationValues.Portrait }; + properties.AppendChild(pageSize); + return properties; } + /// /// Задание форматирования для абзаца /// /// /// - private static ParagraphProperties? - CreateParagraphProperties(WordTextProperties? paragraphProperties) + private static ParagraphProperties? CreateParagraphProperties(WordTextProperties? paragraphProperties) { if (paragraphProperties == null) { return null; } + var properties = new ParagraphProperties(); + properties.AppendChild(new Justification() { - Val = - GetJustificationValues(paragraphProperties.JustificationType) + Val = GetJustificationValues(paragraphProperties.JustificationType) }); + properties.AppendChild(new SpacingBetweenLines { LineRule = LineSpacingRuleValues.Auto }); + properties.AppendChild(new Indentation()); + var paragraphMarkRunProperties = new ParagraphMarkRunProperties(); if (!string.IsNullOrEmpty(paragraphProperties.Size)) { - paragraphMarkRunProperties.AppendChild(new FontSize - { - Val = - paragraphProperties.Size - }); + paragraphMarkRunProperties.AppendChild(new FontSize { Val = paragraphProperties.Size }); } properties.AppendChild(paragraphMarkRunProperties); + return properties; } + protected override void CreateWord(WordInfo info) { - _wordDocument = WordprocessingDocument.Create(info.FileName, - WordprocessingDocumentType.Document); + _wordDocument = WordprocessingDocument.Create(info.FileName, WordprocessingDocumentType.Document); MainDocumentPart mainPart = _wordDocument.AddMainDocumentPart(); mainPart.Document = new Document(); _docBody = mainPart.Document.AppendChild(new Body()); } + protected override void CreateParagraph(WordParagraph paragraph) { if (_docBody == null || paragraph == null) @@ -96,9 +103,11 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements var docParagraph = new Paragraph(); docParagraph.AppendChild(CreateParagraphProperties(paragraph.TextProperties)); + foreach (var run in paragraph.Texts) { var docRun = new Run(); + var properties = new RunProperties(); properties.AppendChild(new FontSize { Val = run.Item2.Size }); if (run.Item2.Bold) @@ -106,16 +115,15 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements properties.AppendChild(new Bold()); } docRun.AppendChild(properties); - docRun.AppendChild(new Text - { - Text = run.Item1, - Space = - SpaceProcessingModeValues.Preserve - }); + + docRun.AppendChild(new Text { Text = run.Item1, Space = SpaceProcessingModeValues.Preserve }); + docParagraph.AppendChild(docRun); } + _docBody.AppendChild(docParagraph); } + protected override void SaveWord(WordInfo info) { if (_docBody == null || _wordDocument == null) @@ -123,7 +131,9 @@ namespace AbstractShopBusinessLogic.OfficePackage.Implements return; } _docBody.AppendChild(CreateSectionProperties()); + _wordDocument.MainDocumentPart!.Document.Save(); + _wordDocument.Dispose(); } } diff --git a/ClothShop/ClothShopContracts/BusinessLogicContracts/IReportLogic.cs b/ClothShop/ClothShopContracts/BusinessLogicContracts/IReportLogic.cs index 9462e82..64527ff 100644 --- a/ClothShop/ClothShopContracts/BusinessLogicContracts/IReportLogic.cs +++ b/ClothShop/ClothShopContracts/BusinessLogicContracts/IReportLogic.cs @@ -27,7 +27,7 @@ namespace ClothShopContracts.BusinessLogicContracts /// Сохранение компонент в файл-Word /// /// - void SaveComponentsToWordFile(ReportBindingModel model); + void SaveTextilesToWordFile(ReportBindingModel model); /// /// Сохранение компонент с указаеним продуктов в файл-Excel /// diff --git a/ClothShop/ClothShopView/FormMain.Designer.cs b/ClothShop/ClothShopView/FormMain.Designer.cs index ee5039d..d43d477 100644 --- a/ClothShop/ClothShopView/FormMain.Designer.cs +++ b/ClothShop/ClothShopView/FormMain.Designer.cs @@ -28,174 +28,165 @@ /// private void InitializeComponent() { - this.dataGridView = new System.Windows.Forms.DataGridView(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.справочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.изделиеToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ReportComponentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ReportTextileComponentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ReportOrdeersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.buttonRefresh = new System.Windows.Forms.Button(); - this.buttonIssuedOrder = new System.Windows.Forms.Button(); - this.buttonOrderReady = new System.Windows.Forms.Button(); - this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); - this.buttonCreateOrder = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); - this.menuStrip.SuspendLayout(); - this.SuspendLayout(); + dataGridView = new DataGridView(); + menuStrip = new MenuStrip(); + справочникиToolStripMenuItem = new ToolStripMenuItem(); + компонентыToolStripMenuItem = new ToolStripMenuItem(); + изделиеToolStripMenuItem = new ToolStripMenuItem(); + ReportToolStripMenuItem = new ToolStripMenuItem(); + ReportTextilesToolStripMenuItem = new ToolStripMenuItem(); + ReportTextileComponentsToolStripMenuItem = new ToolStripMenuItem(); + ReportOrdeersToolStripMenuItem = new ToolStripMenuItem(); + buttonRefresh = new Button(); + buttonIssuedOrder = new Button(); + buttonOrderReady = new Button(); + buttonTakeOrderInWork = new Button(); + buttonCreateOrder = new Button(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + menuStrip.SuspendLayout(); + SuspendLayout(); // // dataGridView // - this.dataGridView.AllowUserToAddRows = false; - this.dataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; - this.dataGridView.BackgroundColor = System.Drawing.Color.White; - this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView.Location = new System.Drawing.Point(12, 31); - this.dataGridView.Name = "dataGridView"; - this.dataGridView.RowHeadersWidth = 51; - this.dataGridView.RowTemplate.Height = 29; - this.dataGridView.Size = new System.Drawing.Size(914, 377); - this.dataGridView.TabIndex = 8; + dataGridView.AllowUserToAddRows = false; + dataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; + dataGridView.BackgroundColor = Color.White; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Location = new Point(12, 31); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.Size = new Size(914, 377); + dataGridView.TabIndex = 8; // // menuStrip // - this.menuStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.справочникиToolStripMenuItem, - this.ReportToolStripMenuItem}); - this.menuStrip.Location = new System.Drawing.Point(0, 0); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(1156, 28); - this.menuStrip.TabIndex = 7; - this.menuStrip.Text = "Меню справочников"; + menuStrip.ImageScalingSize = new Size(20, 20); + menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, ReportToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Size = new Size(1156, 28); + menuStrip.TabIndex = 7; + menuStrip.Text = "Меню справочников"; // // справочникиToolStripMenuItem // - this.справочникиToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.компонентыToolStripMenuItem, - this.изделиеToolStripMenuItem}); - this.справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; - this.справочникиToolStripMenuItem.Size = new System.Drawing.Size(117, 24); - this.справочникиToolStripMenuItem.Text = "Справочники"; + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, изделиеToolStripMenuItem }); + справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; + справочникиToolStripMenuItem.Size = new Size(117, 24); + справочникиToolStripMenuItem.Text = "Справочники"; // // компонентыToolStripMenuItem // - this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(182, 26); - this.компонентыToolStripMenuItem.Text = "Компоненты"; - this.компонентыToolStripMenuItem.Click += new System.EventHandler(this.ComponentsToolStripMenuItem_Click); + компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; + компонентыToolStripMenuItem.Size = new Size(182, 26); + компонентыToolStripMenuItem.Text = "Компоненты"; + компонентыToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click; // // изделиеToolStripMenuItem // - this.изделиеToolStripMenuItem.Name = "изделиеToolStripMenuItem"; - this.изделиеToolStripMenuItem.Size = new System.Drawing.Size(182, 26); - this.изделиеToolStripMenuItem.Text = "Изделие"; - this.изделиеToolStripMenuItem.Click += new System.EventHandler(this.TextileToolStripMenuItem_Click); + изделиеToolStripMenuItem.Name = "изделиеToolStripMenuItem"; + изделиеToolStripMenuItem.Size = new Size(182, 26); + изделиеToolStripMenuItem.Text = "Изделие"; + изделиеToolStripMenuItem.Click += TextileToolStripMenuItem_Click; // // ReportToolStripMenuItem // - this.ReportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.ReportComponentsToolStripMenuItem, - this.ReportTextileComponentsToolStripMenuItem, - this.ReportOrdeersToolStripMenuItem}); - this.ReportToolStripMenuItem.Name = "ReportToolStripMenuItem"; - this.ReportToolStripMenuItem.Size = new System.Drawing.Size(73, 24); - this.ReportToolStripMenuItem.Text = "Отчеты"; + ReportToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ReportTextilesToolStripMenuItem, ReportTextileComponentsToolStripMenuItem, ReportOrdeersToolStripMenuItem }); + ReportToolStripMenuItem.Name = "ReportToolStripMenuItem"; + ReportToolStripMenuItem.Size = new Size(73, 24); + ReportToolStripMenuItem.Text = "Отчеты"; // - // ReportComponentsToolStripMenuItem + // ReportTextilesToolStripMenuItem // - this.ReportComponentsToolStripMenuItem.Name = "ReportComponentsToolStripMenuItem"; - this.ReportComponentsToolStripMenuItem.Size = new System.Drawing.Size(276, 26); - this.ReportComponentsToolStripMenuItem.Text = "Список компонентов"; - this.ReportComponentsToolStripMenuItem.Click += new System.EventHandler(this.ReportComponentsToolStripMenuItem_Click); + ReportTextilesToolStripMenuItem.Name = "ReportTextilesToolStripMenuItem"; + ReportTextilesToolStripMenuItem.Size = new Size(276, 26); + ReportTextilesToolStripMenuItem.Text = "Список изделий"; + ReportTextilesToolStripMenuItem.Click += ReportComponentsToolStripMenuItem_Click; // // ReportTextileComponentsToolStripMenuItem // - this.ReportTextileComponentsToolStripMenuItem.Name = "ReportTextileComponentsToolStripMenuItem"; - this.ReportTextileComponentsToolStripMenuItem.Size = new System.Drawing.Size(276, 26); - this.ReportTextileComponentsToolStripMenuItem.Text = "Компоненты по изделиям"; - this.ReportTextileComponentsToolStripMenuItem.Click += new System.EventHandler(this.ReportTextileComponentsToolStripMenuItem_Click); + ReportTextileComponentsToolStripMenuItem.Name = "ReportTextileComponentsToolStripMenuItem"; + ReportTextileComponentsToolStripMenuItem.Size = new Size(276, 26); + ReportTextileComponentsToolStripMenuItem.Text = "Компоненты по изделиям"; + ReportTextileComponentsToolStripMenuItem.Click += ReportTextileComponentsToolStripMenuItem_Click; // // ReportOrdeersToolStripMenuItem // - this.ReportOrdeersToolStripMenuItem.Name = "ReportOrdeersToolStripMenuItem"; - this.ReportOrdeersToolStripMenuItem.Size = new System.Drawing.Size(276, 26); - this.ReportOrdeersToolStripMenuItem.Text = "Список заказов"; - this.ReportOrdeersToolStripMenuItem.Click += new System.EventHandler(this.ReportOrdersToolStripMenuItem_Click); + ReportOrdeersToolStripMenuItem.Name = "ReportOrdeersToolStripMenuItem"; + ReportOrdeersToolStripMenuItem.Size = new Size(276, 26); + ReportOrdeersToolStripMenuItem.Text = "Список заказов"; + ReportOrdeersToolStripMenuItem.Click += ReportOrdersToolStripMenuItem_Click; // // buttonRefresh // - this.buttonRefresh.Location = new System.Drawing.Point(932, 324); - this.buttonRefresh.Name = "buttonRefresh"; - this.buttonRefresh.Size = new System.Drawing.Size(212, 38); - this.buttonRefresh.TabIndex = 13; - this.buttonRefresh.Text = "Обновить список"; - this.buttonRefresh.UseVisualStyleBackColor = true; - this.buttonRefresh.Click += new System.EventHandler(this.ButtonRef_Click); + buttonRefresh.Location = new Point(932, 324); + buttonRefresh.Name = "buttonRefresh"; + buttonRefresh.Size = new Size(212, 38); + buttonRefresh.TabIndex = 13; + buttonRefresh.Text = "Обновить список"; + buttonRefresh.UseVisualStyleBackColor = true; + buttonRefresh.Click += ButtonRef_Click; // // buttonIssuedOrder // - this.buttonIssuedOrder.Location = new System.Drawing.Point(932, 256); - this.buttonIssuedOrder.Name = "buttonIssuedOrder"; - this.buttonIssuedOrder.Size = new System.Drawing.Size(212, 38); - this.buttonIssuedOrder.TabIndex = 12; - this.buttonIssuedOrder.Text = "Заказ выдан"; - this.buttonIssuedOrder.UseVisualStyleBackColor = true; - this.buttonIssuedOrder.Click += new System.EventHandler(this.ButtonIssuedOrder_Click); + buttonIssuedOrder.Location = new Point(932, 256); + buttonIssuedOrder.Name = "buttonIssuedOrder"; + buttonIssuedOrder.Size = new Size(212, 38); + buttonIssuedOrder.TabIndex = 12; + buttonIssuedOrder.Text = "Заказ выдан"; + buttonIssuedOrder.UseVisualStyleBackColor = true; + buttonIssuedOrder.Click += ButtonIssuedOrder_Click; // // buttonOrderReady // - this.buttonOrderReady.Location = new System.Drawing.Point(932, 190); - this.buttonOrderReady.Name = "buttonOrderReady"; - this.buttonOrderReady.Size = new System.Drawing.Size(212, 38); - this.buttonOrderReady.TabIndex = 11; - this.buttonOrderReady.Text = "Заказ готов"; - this.buttonOrderReady.UseVisualStyleBackColor = true; - this.buttonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click); + buttonOrderReady.Location = new Point(932, 190); + buttonOrderReady.Name = "buttonOrderReady"; + buttonOrderReady.Size = new Size(212, 38); + buttonOrderReady.TabIndex = 11; + buttonOrderReady.Text = "Заказ готов"; + buttonOrderReady.UseVisualStyleBackColor = true; + buttonOrderReady.Click += ButtonOrderReady_Click; // // buttonTakeOrderInWork // - this.buttonTakeOrderInWork.Location = new System.Drawing.Point(932, 124); - this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - this.buttonTakeOrderInWork.Size = new System.Drawing.Size(212, 38); - this.buttonTakeOrderInWork.TabIndex = 10; - this.buttonTakeOrderInWork.Text = "Отдать на выполнение"; - this.buttonTakeOrderInWork.UseVisualStyleBackColor = true; - this.buttonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); + buttonTakeOrderInWork.Location = new Point(932, 124); + buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; + buttonTakeOrderInWork.Size = new Size(212, 38); + buttonTakeOrderInWork.TabIndex = 10; + buttonTakeOrderInWork.Text = "Отдать на выполнение"; + buttonTakeOrderInWork.UseVisualStyleBackColor = true; + buttonTakeOrderInWork.Click += ButtonTakeOrderInWork_Click; // // buttonCreateOrder // - this.buttonCreateOrder.Location = new System.Drawing.Point(932, 56); - this.buttonCreateOrder.Name = "buttonCreateOrder"; - this.buttonCreateOrder.Size = new System.Drawing.Size(212, 38); - this.buttonCreateOrder.TabIndex = 9; - this.buttonCreateOrder.Text = "Создать заказ"; - this.buttonCreateOrder.UseVisualStyleBackColor = true; - this.buttonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click); + buttonCreateOrder.Location = new Point(932, 56); + buttonCreateOrder.Name = "buttonCreateOrder"; + buttonCreateOrder.Size = new Size(212, 38); + buttonCreateOrder.TabIndex = 9; + buttonCreateOrder.Text = "Создать заказ"; + buttonCreateOrder.UseVisualStyleBackColor = true; + buttonCreateOrder.Click += ButtonCreateOrder_Click; // // FormMain // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1156, 417); - this.Controls.Add(this.dataGridView); - this.Controls.Add(this.menuStrip); - this.Controls.Add(this.buttonRefresh); - this.Controls.Add(this.buttonIssuedOrder); - this.Controls.Add(this.buttonOrderReady); - this.Controls.Add(this.buttonTakeOrderInWork); - this.Controls.Add(this.buttonCreateOrder); - this.Name = "FormMain"; - this.Text = "Заказы"; - this.Load += new System.EventHandler(this.FormMain_Load); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1156, 417); + Controls.Add(dataGridView); + Controls.Add(menuStrip); + Controls.Add(buttonRefresh); + Controls.Add(buttonIssuedOrder); + Controls.Add(buttonOrderReady); + Controls.Add(buttonTakeOrderInWork); + Controls.Add(buttonCreateOrder); + Name = "FormMain"; + Text = "Заказы"; + Load += FormMain_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } #endregion @@ -211,7 +202,7 @@ private Button buttonTakeOrderInWork; private Button buttonCreateOrder; private ToolStripMenuItem ReportToolStripMenuItem; - private ToolStripMenuItem ReportComponentsToolStripMenuItem; + private ToolStripMenuItem ReportTextilesToolStripMenuItem; private ToolStripMenuItem ReportTextileComponentsToolStripMenuItem; private ToolStripMenuItem ReportOrdeersToolStripMenuItem; } diff --git a/ClothShop/ClothShopView/FormMain.cs b/ClothShop/ClothShopView/FormMain.cs index f1fa66c..be45995 100644 --- a/ClothShop/ClothShopView/FormMain.cs +++ b/ClothShop/ClothShopView/FormMain.cs @@ -174,7 +174,7 @@ namespace ClothShopView using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; if (dialog.ShowDialog() == DialogResult.OK) { - _reportLogic.SaveComponentsToWordFile(new ReportBindingModel + _reportLogic.SaveTextilesToWordFile(new ReportBindingModel { FileName = dialog.FileName }); diff --git a/ClothShop/ClothShopView/FormMain.resx b/ClothShop/ClothShopView/FormMain.resx index 2a5af73..a4742f3 100644 --- a/ClothShop/ClothShopView/FormMain.resx +++ b/ClothShop/ClothShopView/FormMain.resx @@ -1,4 +1,64 @@ - + + + diff --git a/ClothShop/ClothShopView/FormReportOrders.Designer.cs b/ClothShop/ClothShopView/FormReportOrders.Designer.cs index 941d4b1..d002f36 100644 --- a/ClothShop/ClothShopView/FormReportOrders.Designer.cs +++ b/ClothShop/ClothShopView/FormReportOrders.Designer.cs @@ -41,7 +41,7 @@ // panel.Location = new Point(-1, 48); panel.Name = "panel"; - panel.Size = new Size(800, 401); + panel.Size = new Size(1121, 401); panel.TabIndex = 0; // // label2 @@ -100,7 +100,7 @@ // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(1120, 450); Controls.Add(label2); Controls.Add(panel); Controls.Add(label1);