From f396af1eb906e233f7da9429cc39ed9c3a1f6d9d Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Tue, 28 Mar 2023 10:45:31 +0400 Subject: [PATCH] fix --- Pizzeria/Pizzeria/FormMain.Designer.cs | 4 +- Pizzeria/Pizzeria/FormMain.cs | 7 +- .../Pizzeria/FormReportOrders.Designer.cs | 4 +- .../Pizzeria/FormReportPizzaComponents.cs | 4 +- Pizzeria/Pizzeria/Pizzeria.csproj | 15 +++ .../Pizzeria/Properties/Resources.Designer.cs | 63 +++++++++ Pizzeria/Pizzeria/Properties/Resources.resx | 120 ++++++++++++++++++ Pizzeria/Pizzeria/ReportOrders.rdlc | 82 +++++++++++- .../OfficePackage/AbstractSaveToExcel.cs | 4 +- .../OfficePackage/AbstractSaveToPdf.cs | 6 +- .../OfficePackage/AbstractSaveToWord.cs | 7 +- .../OfficePackage/HelperModels/WordInfo.cs | 2 +- .../OfficePackage/Implements/SaveToWord.cs | 12 +- Pizzeria/PizzeriaBusinessLogic/ReportLogic.cs | 27 ++-- .../ViewModels/ReportOrdersViewModel.cs | 1 + .../ReportPizzaComponentViewModel.cs | 4 +- .../Implements/OrderStorage.cs | 1 + 17 files changed, 313 insertions(+), 50 deletions(-) create mode 100644 Pizzeria/Pizzeria/Properties/Resources.Designer.cs create mode 100644 Pizzeria/Pizzeria/Properties/Resources.resx diff --git a/Pizzeria/Pizzeria/FormMain.Designer.cs b/Pizzeria/Pizzeria/FormMain.Designer.cs index 73ed42d..4115e88 100644 --- a/Pizzeria/Pizzeria/FormMain.Designer.cs +++ b/Pizzeria/Pizzeria/FormMain.Designer.cs @@ -172,8 +172,8 @@ // this.списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; this.списокКомпонентовToolStripMenuItem.Size = new System.Drawing.Size(269, 26); - this.списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; - this.списокКомпонентовToolStripMenuItem.Click += new System.EventHandler(this.ComponentsToolStripMenuItem_Click); + this.списокКомпонентовToolStripMenuItem.Text = "Список пицц"; + this.списокКомпонентовToolStripMenuItem.Click += new System.EventHandler(this.PizzasToolStripMenuItem_Click); // // компонентовПоПиццамToolStripMenuItem // diff --git a/Pizzeria/Pizzeria/FormMain.cs b/Pizzeria/Pizzeria/FormMain.cs index eed58d0..3edbbb3 100644 --- a/Pizzeria/Pizzeria/FormMain.cs +++ b/Pizzeria/Pizzeria/FormMain.cs @@ -153,9 +153,7 @@ namespace Pizzeria LoadData(); } - - private void ComponentsToolStripMenuItem_Click(object sender, EventArgs -e) + private void PizzasToolStripMenuItem_Click(object sender, EventArgs e) { using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; if (dialog.ShowDialog() == DialogResult.OK) @@ -164,8 +162,7 @@ e) { FileName = dialog.FileName }); - MessageBox.Show("", "", MessageBoxButtons.OK, - MessageBoxIcon.Information); + MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void ComponentPizzasToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/Pizzeria/Pizzeria/FormReportOrders.Designer.cs b/Pizzeria/Pizzeria/FormReportOrders.Designer.cs index 72dd438..8d5991d 100644 --- a/Pizzeria/Pizzeria/FormReportOrders.Designer.cs +++ b/Pizzeria/Pizzeria/FormReportOrders.Designer.cs @@ -94,14 +94,14 @@ this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel.Location = new System.Drawing.Point(0, 46); this.panel.Name = "panel"; - this.panel.Size = new System.Drawing.Size(843, 409); + this.panel.Size = new System.Drawing.Size(937, 409); this.panel.TabIndex = 7; // // FormReportOrders // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(842, 470); + this.ClientSize = new System.Drawing.Size(942, 470); this.Controls.Add(this.panel); this.Controls.Add(this.button2); this.Controls.Add(this.button1); diff --git a/Pizzeria/Pizzeria/FormReportPizzaComponents.cs b/Pizzeria/Pizzeria/FormReportPizzaComponents.cs index fb5b94f..5dda768 100644 --- a/Pizzeria/Pizzeria/FormReportPizzaComponents.cs +++ b/Pizzeria/Pizzeria/FormReportPizzaComponents.cs @@ -23,8 +23,8 @@ namespace Pizzeria dataGridView.Rows.Clear(); foreach (var elem in dict) { - dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" }); - foreach (var listElem in elem.Pizzas) + dataGridView.Rows.Add(new object[] { elem.PizzaName, "", "" }); + foreach (var listElem in elem.Components) { dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); } diff --git a/Pizzeria/Pizzeria/Pizzeria.csproj b/Pizzeria/Pizzeria/Pizzeria.csproj index 9b2c453..6b2550f 100644 --- a/Pizzeria/Pizzeria/Pizzeria.csproj +++ b/Pizzeria/Pizzeria/Pizzeria.csproj @@ -26,6 +26,21 @@ + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + Always diff --git a/Pizzeria/Pizzeria/Properties/Resources.Designer.cs b/Pizzeria/Pizzeria/Properties/Resources.Designer.cs new file mode 100644 index 0000000..13c5d43 --- /dev/null +++ b/Pizzeria/Pizzeria/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace Pizzeria.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Pizzeria.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Pizzeria/Pizzeria/Properties/Resources.resx b/Pizzeria/Pizzeria/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Pizzeria/Pizzeria/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Pizzeria/Pizzeria/ReportOrders.rdlc b/Pizzeria/Pizzeria/ReportOrders.rdlc index 0eb814a..fdc4a16 100644 --- a/Pizzeria/Pizzeria/ReportOrders.rdlc +++ b/Pizzeria/Pizzeria/ReportOrders.rdlc @@ -29,6 +29,10 @@ PizzaName System.String + + OrderStatus + System.String + Sum System.Decimal @@ -116,16 +120,19 @@ - 2.5cm + 2.0889cm - 3.21438cm + 2.80328cm - 8.23317cm + 7.82207cm - 2.5cm + 2.0889cm + + + 2.0889cm @@ -228,6 +235,38 @@ + + + + true + true + + + + + Order Status + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -357,6 +396,36 @@ + + + + true + true + + + + + =Fields!OrderStatus.Value + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -397,6 +466,7 @@ + @@ -413,7 +483,7 @@ 2.48391cm 0.55245cm 1.2cm - 16.44755cm + 16.89205cm 2