diff --git a/FishFactory/FishFactory.csproj b/FishFactory/FishFactory.csproj
index 07508e2..d544413 100644
--- a/FishFactory/FishFactory.csproj
+++ b/FishFactory/FishFactory.csproj
@@ -14,6 +14,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
+
@@ -25,4 +26,19 @@
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/FishFactory/FormCanned.Designer.cs b/FishFactory/Forms/FormCanned.Designer.cs
similarity index 100%
rename from FishFactory/FormCanned.Designer.cs
rename to FishFactory/Forms/FormCanned.Designer.cs
diff --git a/FishFactory/FormCanned.cs b/FishFactory/Forms/FormCanned.cs
similarity index 86%
rename from FishFactory/FormCanned.cs
rename to FishFactory/Forms/FormCanned.cs
index 8b515ea..c6dd870 100644
--- a/FishFactory/FormCanned.cs
+++ b/FishFactory/Forms/FormCanned.cs
@@ -11,14 +11,14 @@ namespace FishFactory.Forms
private readonly ILogger _logger;
private readonly ICannedLogic _logic;
private int? _id;
- private Dictionary _productComponents;
+ private Dictionary _CannedComponents;
public int Id { set { _id = value; } }
public FormCanned(ILogger logger, ICannedLogic logic)
{
InitializeComponent();
_logger = logger;
_logic = logic;
- _productComponents = new Dictionary();
+ _CannedComponents = new Dictionary();
}
private void FormCanned_Load(object sender, EventArgs e)
{
@@ -35,7 +35,7 @@ namespace FishFactory.Forms
{
textBoxName.Text = view.CannedName;
textBoxPrice.Text = view.Price.ToString();
- _productComponents = view.CannedComponents ?? new Dictionary();
+ _CannedComponents = view.CannedComponents ?? new Dictionary();
LoadData();
}
}
@@ -50,10 +50,10 @@ namespace FishFactory.Forms
_logger.LogInformation("Загрузка компонент изделия");
try
{
- if (_productComponents != null)
+ if (_CannedComponents != null)
{
dataGridView.Rows.Clear();
- foreach (var pc in _productComponents)
+ foreach (var pc in _CannedComponents)
{
dataGridView.Rows.Add(new object[] { pc.Key, pc.Value.Item1.ComponentName, pc.Value.Item2 });
}
@@ -77,13 +77,13 @@ namespace FishFactory.Forms
return;
}
_logger.LogInformation("Добавление нового компонента: { ComponentName} - { Count} ", form.ComponentModel.ComponentName, form.Count);
- if (_productComponents.ContainsKey(form.Id))
+ if (_CannedComponents.ContainsKey(form.Id))
{
- _productComponents[form.Id] = (form.ComponentModel, form.Count);
+ _CannedComponents[form.Id] = (form.ComponentModel, form.Count);
}
else
{
- _productComponents.Add(form.Id, (form.ComponentModel, form.Count));
+ _CannedComponents.Add(form.Id, (form.ComponentModel, form.Count));
}
LoadData();
}
@@ -98,7 +98,7 @@ namespace FishFactory.Forms
{
int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value);
form.Id = id;
- form.Count = _productComponents[id].Item2;
+ form.Count = _CannedComponents[id].Item2;
if (form.ShowDialog() == DialogResult.OK)
{
if (form.ComponentModel == null)
@@ -106,7 +106,7 @@ namespace FishFactory.Forms
return;
}
_logger.LogInformation("Изменение компонента: { ComponentName} - { Count}", form.ComponentModel.ComponentName, form.Count);
- _productComponents[form.Id] = (form.ComponentModel, form.Count);
+ _CannedComponents[form.Id] = (form.ComponentModel, form.Count);
LoadData();
}
}
@@ -121,7 +121,7 @@ namespace FishFactory.Forms
try
{
_logger.LogInformation("Удаление компонента: { ComponentName} - { Count}", dataGridView.SelectedRows[0].Cells[1].Value);
- _productComponents?.Remove(Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value));
+ _CannedComponents?.Remove(Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value));
}
catch (Exception ex)
{
@@ -147,7 +147,7 @@ namespace FishFactory.Forms
MessageBox.Show("Заполните цену", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
- if (_productComponents == null || _productComponents.Count == 0)
+ if (_CannedComponents == null || _CannedComponents.Count == 0)
{
MessageBox.Show("Заполните компоненты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
@@ -160,7 +160,7 @@ namespace FishFactory.Forms
Id = _id ?? 0,
CannedName = textBoxName.Text,
Price = Convert.ToDouble(textBoxPrice.Text),
- CannedComponents = _productComponents
+ CannedComponents = _CannedComponents
};
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
if (!operationResult)
@@ -186,7 +186,7 @@ namespace FishFactory.Forms
private double CalcPrice()
{
double price = 0;
- foreach (var elem in _productComponents)
+ foreach (var elem in _CannedComponents)
{
price += ((elem.Value.Item1?.Cost ?? 0) * elem.Value.Item2);
}
diff --git a/FishFactory/FormCanned.resx b/FishFactory/Forms/FormCanned.resx
similarity index 100%
rename from FishFactory/FormCanned.resx
rename to FishFactory/Forms/FormCanned.resx
diff --git a/FishFactory/FormCannedComponent.Designer.cs b/FishFactory/Forms/FormCannedComponent.Designer.cs
similarity index 100%
rename from FishFactory/FormCannedComponent.Designer.cs
rename to FishFactory/Forms/FormCannedComponent.Designer.cs
diff --git a/FishFactory/FormCannedComponent.cs b/FishFactory/Forms/FormCannedComponent.cs
similarity index 100%
rename from FishFactory/FormCannedComponent.cs
rename to FishFactory/Forms/FormCannedComponent.cs
diff --git a/FishFactory/FormCannedComponent.resx b/FishFactory/Forms/FormCannedComponent.resx
similarity index 100%
rename from FishFactory/FormCannedComponent.resx
rename to FishFactory/Forms/FormCannedComponent.resx
diff --git a/FishFactory/FormCanneds.Designer.cs b/FishFactory/Forms/FormCanneds.Designer.cs
similarity index 100%
rename from FishFactory/FormCanneds.Designer.cs
rename to FishFactory/Forms/FormCanneds.Designer.cs
diff --git a/FishFactory/FormCanneds.cs b/FishFactory/Forms/FormCanneds.cs
similarity index 100%
rename from FishFactory/FormCanneds.cs
rename to FishFactory/Forms/FormCanneds.cs
diff --git a/FishFactory/FormCanneds.resx b/FishFactory/Forms/FormCanneds.resx
similarity index 100%
rename from FishFactory/FormCanneds.resx
rename to FishFactory/Forms/FormCanneds.resx
diff --git a/FishFactory/FormComponent.Designer.cs b/FishFactory/Forms/FormComponent.Designer.cs
similarity index 100%
rename from FishFactory/FormComponent.Designer.cs
rename to FishFactory/Forms/FormComponent.Designer.cs
diff --git a/FishFactory/FormComponent.cs b/FishFactory/Forms/FormComponent.cs
similarity index 100%
rename from FishFactory/FormComponent.cs
rename to FishFactory/Forms/FormComponent.cs
diff --git a/FishFactory/FormComponent.resx b/FishFactory/Forms/FormComponent.resx
similarity index 100%
rename from FishFactory/FormComponent.resx
rename to FishFactory/Forms/FormComponent.resx
diff --git a/FishFactory/FormComponents.Designer.cs b/FishFactory/Forms/FormComponents.Designer.cs
similarity index 100%
rename from FishFactory/FormComponents.Designer.cs
rename to FishFactory/Forms/FormComponents.Designer.cs
diff --git a/FishFactory/FormComponents.cs b/FishFactory/Forms/FormComponents.cs
similarity index 100%
rename from FishFactory/FormComponents.cs
rename to FishFactory/Forms/FormComponents.cs
diff --git a/FishFactory/FormComponents.resx b/FishFactory/Forms/FormComponents.resx
similarity index 100%
rename from FishFactory/FormComponents.resx
rename to FishFactory/Forms/FormComponents.resx
diff --git a/FishFactory/FormCreateOrder.Designer.cs b/FishFactory/Forms/FormCreateOrder.Designer.cs
similarity index 100%
rename from FishFactory/FormCreateOrder.Designer.cs
rename to FishFactory/Forms/FormCreateOrder.Designer.cs
diff --git a/FishFactory/FormCreateOrder.cs b/FishFactory/Forms/FormCreateOrder.cs
similarity index 100%
rename from FishFactory/FormCreateOrder.cs
rename to FishFactory/Forms/FormCreateOrder.cs
diff --git a/FishFactory/FormCreateOrder.resx b/FishFactory/Forms/FormCreateOrder.resx
similarity index 100%
rename from FishFactory/FormCreateOrder.resx
rename to FishFactory/Forms/FormCreateOrder.resx
diff --git a/FishFactory/FormMain.Designer.cs b/FishFactory/Forms/FormMain.Designer.cs
similarity index 63%
rename from FishFactory/FormMain.Designer.cs
rename to FishFactory/Forms/FormMain.Designer.cs
index 73fef74..4b7e0e5 100644
--- a/FishFactory/FormMain.Designer.cs
+++ b/FishFactory/Forms/FormMain.Designer.cs
@@ -39,6 +39,10 @@
buttonIssuedOrder = new Button();
buttonRef = new Button();
dataGridView = new DataGridView();
+ toolStripDropDownButton2 = new ToolStripDropDownButton();
+ списокКомпонентовToolStripMenuItem = new ToolStripMenuItem();
+ компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem();
+ списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
@@ -46,10 +50,10 @@
// toolStrip1
//
toolStrip1.ImageScalingSize = new Size(20, 20);
- toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1 });
+ toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, toolStripDropDownButton2 });
toolStrip1.Location = new Point(0, 0);
toolStrip1.Name = "toolStrip1";
- toolStrip1.Size = new Size(1107, 27);
+ toolStrip1.Size = new Size(969, 25);
toolStrip1.TabIndex = 0;
toolStrip1.Text = "toolStrip1";
//
@@ -60,29 +64,28 @@
toolStripDropDownButton1.Image = (Image)resources.GetObject("toolStripDropDownButton1.Image");
toolStripDropDownButton1.ImageTransparentColor = Color.Magenta;
toolStripDropDownButton1.Name = "toolStripDropDownButton1";
- toolStripDropDownButton1.Size = new Size(108, 24);
+ toolStripDropDownButton1.Size = new Size(88, 22);
toolStripDropDownButton1.Text = "Справочник";
//
// компонентыToolStripMenuItem
//
компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem";
- компонентыToolStripMenuItem.Size = new Size(182, 26);
+ компонентыToolStripMenuItem.Size = new Size(145, 22);
компонентыToolStripMenuItem.Text = "Компоненты";
компонентыToolStripMenuItem.Click += компонентыToolStripMenuItem_Click;
//
// консервыToolStripMenuItem
//
консервыToolStripMenuItem.Name = "консервыToolStripMenuItem";
- консервыToolStripMenuItem.Size = new Size(182, 26);
+ консервыToolStripMenuItem.Size = new Size(145, 22);
консервыToolStripMenuItem.Text = "Консервы";
консервыToolStripMenuItem.Click += консервыToolStripMenuItem_Click;
//
// buttonCreateOrder
//
- buttonCreateOrder.Location = new Point(914, 75);
- buttonCreateOrder.Margin = new Padding(3, 4, 3, 4);
+ buttonCreateOrder.Location = new Point(800, 56);
buttonCreateOrder.Name = "buttonCreateOrder";
- buttonCreateOrder.Size = new Size(161, 32);
+ buttonCreateOrder.Size = new Size(141, 24);
buttonCreateOrder.TabIndex = 1;
buttonCreateOrder.Text = "Создать заказ";
buttonCreateOrder.UseVisualStyleBackColor = true;
@@ -90,10 +93,9 @@
//
// buttonTakeOrderInWork
//
- buttonTakeOrderInWork.Location = new Point(914, 133);
- buttonTakeOrderInWork.Margin = new Padding(3, 4, 3, 4);
+ buttonTakeOrderInWork.Location = new Point(800, 100);
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
- buttonTakeOrderInWork.Size = new Size(161, 32);
+ buttonTakeOrderInWork.Size = new Size(141, 24);
buttonTakeOrderInWork.TabIndex = 2;
buttonTakeOrderInWork.Text = "Отдать на выполнение";
buttonTakeOrderInWork.UseVisualStyleBackColor = true;
@@ -101,10 +103,9 @@
//
// buttonOrderReady
//
- buttonOrderReady.Location = new Point(914, 190);
- buttonOrderReady.Margin = new Padding(3, 4, 3, 4);
+ buttonOrderReady.Location = new Point(800, 142);
buttonOrderReady.Name = "buttonOrderReady";
- buttonOrderReady.Size = new Size(161, 32);
+ buttonOrderReady.Size = new Size(141, 24);
buttonOrderReady.TabIndex = 3;
buttonOrderReady.Text = "Заказ готов";
buttonOrderReady.UseVisualStyleBackColor = true;
@@ -112,10 +113,9 @@
//
// buttonIssuedOrder
//
- buttonIssuedOrder.Location = new Point(914, 241);
- buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4);
+ buttonIssuedOrder.Location = new Point(800, 181);
buttonIssuedOrder.Name = "buttonIssuedOrder";
- buttonIssuedOrder.Size = new Size(161, 32);
+ buttonIssuedOrder.Size = new Size(141, 24);
buttonIssuedOrder.TabIndex = 4;
buttonIssuedOrder.Text = "Заказ выдан";
buttonIssuedOrder.UseVisualStyleBackColor = true;
@@ -123,10 +123,9 @@
//
// buttonRef
//
- buttonRef.Location = new Point(914, 296);
- buttonRef.Margin = new Padding(3, 4, 3, 4);
+ buttonRef.Location = new Point(800, 222);
buttonRef.Name = "buttonRef";
- buttonRef.Size = new Size(161, 32);
+ buttonRef.Size = new Size(141, 24);
buttonRef.TabIndex = 5;
buttonRef.Text = "Обновить список";
buttonRef.UseVisualStyleBackColor = true;
@@ -135,21 +134,51 @@
// dataGridView
//
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- dataGridView.Location = new Point(0, 35);
- dataGridView.Margin = new Padding(3, 4, 3, 4);
+ dataGridView.Location = new Point(0, 26);
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 24;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
- dataGridView.Size = new Size(872, 580);
+ dataGridView.Size = new Size(763, 435);
dataGridView.TabIndex = 6;
//
+ // toolStripDropDownButton2
+ //
+ toolStripDropDownButton2.DisplayStyle = ToolStripItemDisplayStyle.Text;
+ toolStripDropDownButton2.DropDownItems.AddRange(new ToolStripItem[] { списокКомпонентовToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem });
+ toolStripDropDownButton2.Image = (Image)resources.GetObject("toolStripDropDownButton2.Image");
+ toolStripDropDownButton2.ImageTransparentColor = Color.Magenta;
+ toolStripDropDownButton2.Name = "toolStripDropDownButton2";
+ toolStripDropDownButton2.Size = new Size(61, 22);
+ toolStripDropDownButton2.Text = "Отчёты";
+ //
+ // списокКомпонентовToolStripMenuItem
+ //
+ списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem";
+ списокКомпонентовToolStripMenuItem.Size = new Size(225, 22);
+ списокКомпонентовToolStripMenuItem.Text = "Список компонентов";
+ списокКомпонентовToolStripMenuItem.Click += списокКомпонентовToolStripMenuItem_Click;
+ //
+ // компонентыПоИзделиямToolStripMenuItem
+ //
+ компонентыПоИзделиямToolStripMenuItem.Name = "компонентыПоИзделиямToolStripMenuItem";
+ компонентыПоИзделиямToolStripMenuItem.Size = new Size(225, 22);
+ компонентыПоИзделиямToolStripMenuItem.Text = "Компоненты по консервам";
+ компонентыПоИзделиямToolStripMenuItem.Click += компонентыПоИзделиямToolStripMenuItem_Click;
+ //
+ // списокЗаказовToolStripMenuItem
+ //
+ списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
+ списокЗаказовToolStripMenuItem.Size = new Size(225, 22);
+ списокЗаказовToolStripMenuItem.Text = "Список заказов";
+ списокЗаказовToolStripMenuItem.Click += списокЗаказовToolStripMenuItem_Click;
+ //
// FormMain
//
- AutoScaleDimensions = new SizeF(8F, 20F);
+ AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
- ClientSize = new Size(1107, 615);
+ ClientSize = new Size(969, 461);
Controls.Add(dataGridView);
Controls.Add(buttonRef);
Controls.Add(buttonIssuedOrder);
@@ -157,7 +186,6 @@
Controls.Add(buttonTakeOrderInWork);
Controls.Add(buttonCreateOrder);
Controls.Add(toolStrip1);
- Margin = new Padding(3, 4, 3, 4);
Name = "FormMain";
Text = "Рыбный завод";
Load += FormMain_Load;
@@ -180,5 +208,9 @@
private ToolStripDropDownButton toolStripDropDownButton1;
private ToolStripMenuItem компонентыToolStripMenuItem;
private ToolStripMenuItem консервыToolStripMenuItem;
+ private ToolStripDropDownButton toolStripDropDownButton2;
+ private ToolStripMenuItem списокКомпонентовToolStripMenuItem;
+ private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem;
+ private ToolStripMenuItem списокЗаказовToolStripMenuItem;
}
}
\ No newline at end of file
diff --git a/FishFactory/FormMain.cs b/FishFactory/Forms/FormMain.cs
similarity index 80%
rename from FishFactory/FormMain.cs
rename to FishFactory/Forms/FormMain.cs
index b8c0b8f..149ea78 100644
--- a/FishFactory/FormMain.cs
+++ b/FishFactory/Forms/FormMain.cs
@@ -1,15 +1,7 @@
-using FishFactoryContracts.BindingModels;
+using FishFactoryBusinessLogic.BusinessLogic;
+using FishFactoryContracts.BindingModels;
using FishFactoryContracts.BusinessLogicsContracts;
using Microsoft.Extensions.Logging;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
namespace FishFactory.Forms
{
@@ -17,6 +9,7 @@ namespace FishFactory.Forms
{
private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic;
+ private readonly IReportLogic _reportLogic;
public FormMain(ILogger logger, IOrderLogic orderLogic)
{
InitializeComponent();
@@ -151,5 +144,38 @@ namespace FishFactory.Forms
{
LoadData();
}
+
+ private void списокКомпонентовToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveComponentsToWordFile(new ReportBindingModel
+ {
+ FileName = dialog.FileName
+ });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+
+ }
+
+ private void компонентыПоИзделиямToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportCannedComponents));
+ if (service is FormReportCannedComponents form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void списокЗаказовToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
+ if (service is FormReportOrders form)
+ {
+ form.ShowDialog();
+ }
+ }
}
}
diff --git a/FishFactory/FormMain.resx b/FishFactory/Forms/FormMain.resx
similarity index 89%
rename from FishFactory/FormMain.resx
rename to FishFactory/Forms/FormMain.resx
index 672dbc1..a50214e 100644
--- a/FishFactory/FormMain.resx
+++ b/FishFactory/Forms/FormMain.resx
@@ -124,7 +124,7 @@
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
@@ -134,6 +134,17 @@
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhL3ZErDsJAGIR7DlA47oArV8CDR9RiSDAQPBcA
+ Qx1BgUMQBEk1ooJAKE0I4Wlqf5gmu1n6oqW7hiZfthkx33aqeZ5HKvEFpmmSYRhSQScXINB1XSroDAke
+ 96cUpAmupyPZsx7Z8x4drAnPpQmsgU7LdoHDJNIEYjnAlyBXJ3jPhVyaYLca8nLMhX+CPJXAOT+ouTj5
+ p5in4asApdWpS8XRwT+zShIFG/fOyxlZJbGC9f5G5bHzUf6LJFJQqTViyxlxEmRiHhLUW10qDbeRpUGC
+ ErwjE/OQoG9dIsviYGWsXMwxc24BYLcO5pgZc+cWJIG5MbsyAUDnHwlUAkFHJZraR9NeMVq3zi+WF/0A
+ AAAASUVORK5CYII=
diff --git a/FishFactory/Forms/FormReportCannedComponents.Designer.cs b/FishFactory/Forms/FormReportCannedComponents.Designer.cs
new file mode 100644
index 0000000..497ff67
--- /dev/null
+++ b/FishFactory/Forms/FormReportCannedComponents.Designer.cs
@@ -0,0 +1,99 @@
+namespace FishFactory.Forms
+{
+ partial class FormReportCannedComponents
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ buttonSaveToExcel = new Button();
+ dataGridView = new DataGridView();
+ Component = new DataGridViewTextBoxColumn();
+ Canned = new DataGridViewTextBoxColumn();
+ Count = new DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ SuspendLayout();
+ //
+ // buttonSaveToExcel
+ //
+ buttonSaveToExcel.Location = new Point(27, 15);
+ buttonSaveToExcel.Name = "buttonSaveToExcel";
+ buttonSaveToExcel.Size = new Size(160, 23);
+ buttonSaveToExcel.TabIndex = 0;
+ buttonSaveToExcel.Text = "Сохранить в Excel";
+ buttonSaveToExcel.UseVisualStyleBackColor = true;
+ buttonSaveToExcel.Click += buttonSaveToExcel_Click;
+ //
+ // dataGridView
+ //
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Columns.AddRange(new DataGridViewColumn[] { Component, Canned, Count });
+ dataGridView.Location = new Point(0, 47);
+ dataGridView.Name = "dataGridView";
+ dataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
+ dataGridView.RowTemplate.Height = 25;
+ dataGridView.Size = new Size(799, 438);
+ dataGridView.TabIndex = 1;
+ //
+ // Component
+ //
+ Component.HeaderText = "Компонент";
+ Component.Name = "Component";
+ Component.ReadOnly = true;
+ //
+ // Canned
+ //
+ Canned.HeaderText = "Консервы";
+ Canned.Name = "Canned";
+ //
+ // Count
+ //
+ Count.HeaderText = "Количество";
+ Count.Name = "Count";
+ Count.ReadOnly = true;
+ //
+ // FormReportCannedComponents
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(801, 484);
+ Controls.Add(dataGridView);
+ Controls.Add(buttonSaveToExcel);
+ Name = "FormReportCannedComponents";
+ Text = "Компоненты по консервам";
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Button buttonSaveToExcel;
+ private DataGridView dataGridView;
+ private DataGridViewTextBoxColumn Component;
+ private DataGridViewTextBoxColumn Canned;
+ private DataGridViewTextBoxColumn Count;
+ }
+}
\ No newline at end of file
diff --git a/FishFactory/Forms/FormReportCannedComponents.cs b/FishFactory/Forms/FormReportCannedComponents.cs
new file mode 100644
index 0000000..83129d3
--- /dev/null
+++ b/FishFactory/Forms/FormReportCannedComponents.cs
@@ -0,0 +1,73 @@
+using FishFactoryContracts.BindingModels;
+using FishFactoryContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+
+namespace FishFactory.Forms
+{
+ public partial class FormReportCannedComponents : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+ public FormReportCannedComponents(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ }
+ private void FormReportCannedComponents_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var dict = _logic.GetCannedComponent();
+ if (dict != null)
+ {
+ dataGridView.Rows.Clear();
+ foreach (var elem in dict)
+ {
+ dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" });
+ foreach (var listElem in elem.Canneds)
+ {
+ dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
+ }
+ dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount });
+ dataGridView.Rows.Add(Array.Empty