diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshopView.csproj b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshopView.csproj
index ae37a5d..59d8696 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshopView.csproj
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshopView.csproj
@@ -10,12 +10,20 @@
+
+
Always
+
+ Always
+
+
+ Always
+
@@ -25,6 +33,7 @@
+
@@ -35,4 +44,10 @@
+
+
+ Form
+
+
+
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs
index 305d5d8..8745b33 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs
@@ -33,6 +33,12 @@
this.componentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.manufacturesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.storesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportComponentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportManufactureComponentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportOrdersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportStoresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.reportManufacturesInStoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.buttonCreateOrder = new System.Windows.Forms.Button();
this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
@@ -41,6 +47,7 @@
this.buttonRef = new System.Windows.Forms.Button();
this.buttonFillStore = new System.Windows.Forms.Button();
this.buttonSellManufacture = new System.Windows.Forms.Button();
+ this.reportGroupOrdersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
@@ -48,7 +55,8 @@
// menuStrip
//
this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.refbooksToolStripMenuItem});
+ this.refbooksToolStripMenuItem,
+ this.reportToolStripMenuItem});
this.menuStrip.Location = new System.Drawing.Point(0, 0);
this.menuStrip.Name = "menuStrip";
this.menuStrip.Size = new System.Drawing.Size(1108, 24);
@@ -86,6 +94,54 @@
this.storesToolStripMenuItem.Text = "Магазины";
this.storesToolStripMenuItem.Click += new System.EventHandler(this.StoresToolStripMenuItem_Click);
//
+ // reportToolStripMenuItem
+ //
+ this.reportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.reportComponentsToolStripMenuItem,
+ this.reportManufactureComponentsToolStripMenuItem,
+ this.reportOrdersToolStripMenuItem,
+ this.reportStoresToolStripMenuItem,
+ this.reportManufacturesInStoreToolStripMenuItem,
+ this.reportGroupOrdersToolStripMenuItem});
+ this.reportToolStripMenuItem.Name = "reportToolStripMenuItem";
+ this.reportToolStripMenuItem.Size = new System.Drawing.Size(51, 20);
+ this.reportToolStripMenuItem.Text = "Отчет";
+ //
+ // reportComponentsToolStripMenuItem
+ //
+ this.reportComponentsToolStripMenuItem.Name = "reportComponentsToolStripMenuItem";
+ this.reportComponentsToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportComponentsToolStripMenuItem.Text = "Список компонентов";
+ this.reportComponentsToolStripMenuItem.Click += new System.EventHandler(this.ReportComponentsToolStripMenuItem_Click);
+ //
+ // reportManufactureComponentsToolStripMenuItem
+ //
+ this.reportManufactureComponentsToolStripMenuItem.Name = "reportManufactureComponentsToolStripMenuItem";
+ this.reportManufactureComponentsToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportManufactureComponentsToolStripMenuItem.Text = "Компоненты по изделиям";
+ this.reportManufactureComponentsToolStripMenuItem.Click += new System.EventHandler(this.ReportManufactureComponentsToolStripMenuItem_Click);
+ //
+ // reportOrdersToolStripMenuItem
+ //
+ this.reportOrdersToolStripMenuItem.Name = "reportOrdersToolStripMenuItem";
+ this.reportOrdersToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportOrdersToolStripMenuItem.Text = "Список заказов";
+ this.reportOrdersToolStripMenuItem.Click += new System.EventHandler(this.ReportOrdersToolStripMenuItem_Click);
+ //
+ // reportStoresToolStripMenuItem
+ //
+ this.reportStoresToolStripMenuItem.Name = "reportStoresToolStripMenuItem";
+ this.reportStoresToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportStoresToolStripMenuItem.Text = "Список магазинов";
+ this.reportStoresToolStripMenuItem.Click += new System.EventHandler(this.ReportStoresToolStripMenuItem_Click);
+ //
+ // reportManufacturesInStoreToolStripMenuItem
+ //
+ this.reportManufacturesInStoreToolStripMenuItem.Name = "reportManufacturesInStoreToolStripMenuItem";
+ this.reportManufacturesInStoreToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportManufacturesInStoreToolStripMenuItem.Text = "Изделия в магазинах";
+ this.reportManufacturesInStoreToolStripMenuItem.Click += new System.EventHandler(this.ReportManufacturesInStoreToolStripMenuItem_Click);
+ //
// dataGridView
//
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
@@ -172,6 +228,13 @@
this.buttonSellManufacture.UseVisualStyleBackColor = true;
this.buttonSellManufacture.Click += new System.EventHandler(this.ButtonSellManufacture_Click);
//
+ // reportGroupOrdersToolStripMenuItem
+ //
+ this.reportGroupOrdersToolStripMenuItem.Name = "reportGroupOrdersToolStripMenuItem";
+ this.reportGroupOrdersToolStripMenuItem.Size = new System.Drawing.Size(218, 22);
+ this.reportGroupOrdersToolStripMenuItem.Text = "Заказы по датам";
+ this.reportGroupOrdersToolStripMenuItem.Click += new System.EventHandler(this.ReportGroupOrdersToolStripMenuItem_Click);
+ //
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -213,5 +276,12 @@
private ToolStripMenuItem storesToolStripMenuItem;
private Button buttonFillStore;
private Button buttonSellManufacture;
+ private ToolStripMenuItem reportToolStripMenuItem;
+ private ToolStripMenuItem reportComponentsToolStripMenuItem;
+ private ToolStripMenuItem reportManufactureComponentsToolStripMenuItem;
+ private ToolStripMenuItem reportOrdersToolStripMenuItem;
+ private ToolStripMenuItem reportStoresToolStripMenuItem;
+ private ToolStripMenuItem reportManufacturesInStoreToolStripMenuItem;
+ private ToolStripMenuItem reportGroupOrdersToolStripMenuItem;
}
}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs
index 9206973..6c14fe6 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs
@@ -1,5 +1,6 @@
using BlacksmithWorkshopContracts.BindingModels;
using BlacksmithWorkshopContracts.BusinessLogicContracts;
+using BlacksmithWorkshopContracts.BusinessLogicsContracts;
using Microsoft.Extensions.Logging;
namespace BlacksmithWorkshopView
@@ -9,11 +10,13 @@ namespace BlacksmithWorkshopView
private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic;
- public FormMain(ILogger logger, IOrderLogic orderLogic)
+ private readonly IReportLogic _reportLogic;
+ public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic)
{
InitializeComponent();
_logger = logger;
_orderLogic = orderLogic;
+ _reportLogic = reportLogic;
}
private void FormMain_Load(object sender, EventArgs e)
{
@@ -170,5 +173,62 @@ namespace BlacksmithWorkshopView
form.ShowDialog();
}
}
+ private void ReportComponentsToolStripMenuItem_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 ReportManufactureComponentsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportManufactureComponents));
+ if (service is FormReportManufactureComponents form)
+ {
+ form.ShowDialog();
+ LoadData();
+ }
+ }
+ private void ReportOrdersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
+ if (service is FormReportOrders form)
+ {
+ form.ShowDialog();
+ LoadData();
+ }
+ }
+
+ private void ReportStoresToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveStoresToWordFile(new ReportBindingModel { FileName = dialog.FileName });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private void ReportManufacturesInStoreToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportManufacturesInStore));
+ if (service is FormReportManufacturesInStore form)
+ {
+ form.ShowDialog();
+ LoadData();
+ }
+ }
+
+ private void ReportGroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupOrders));
+ if (service is FormReportGroupOrders form)
+ {
+ form.ShowDialog();
+ LoadData();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.cs
new file mode 100644
index 0000000..a4abc4f
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.cs
@@ -0,0 +1,71 @@
+using BlacksmithWorkshopContracts.BindingModels;
+using BlacksmithWorkshopContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+using Microsoft.Reporting.WinForms;
+
+namespace BlacksmithWorkshopView
+{
+ public partial class FormReportGroupOrders : Form
+ {
+ private readonly ReportViewer reportViewer;
+
+ private readonly ILogger _logger;
+
+ private readonly IReportLogic _logic;
+
+ public FormReportGroupOrders(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ reportViewer = new ReportViewer
+ {
+ Dock = DockStyle.Fill
+ };
+ reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportGroupOrders.rdlc", FileMode.Open));
+ Controls.Clear();
+ Controls.Add(reportViewer);
+ Controls.Add(panel);
+ }
+
+ private void ButtonMake_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ var dataSource = _logic.GetGroupOrders();
+ var source = new ReportDataSource("DataSetOrders", dataSource);
+ reportViewer.LocalReport.DataSources.Clear();
+ reportViewer.LocalReport.DataSources.Add(source);
+
+ reportViewer.RefreshReport();
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка загрузки списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonToPdf_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ _logic.SaveGroupOrdersToPdfFile(new ReportBindingModel
+ {
+ FileName = dialog.FileName
+ });
+ _logger.LogInformation("Сохранение списка заказов");
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка сохранения списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.designer.cs
new file mode 100644
index 0000000..a1bb41b
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.designer.cs
@@ -0,0 +1,92 @@
+namespace BlacksmithWorkshopView
+{
+ partial class FormReportGroupOrders
+ {
+ ///
+ /// 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()
+ {
+ this.panel = new System.Windows.Forms.Panel();
+ this.buttonToPdf = new System.Windows.Forms.Button();
+ this.buttonMake = new System.Windows.Forms.Button();
+ this.panel.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel
+ //
+ this.panel.Controls.Add(this.buttonToPdf);
+ this.panel.Controls.Add(this.buttonMake);
+ this.panel.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel.Location = new System.Drawing.Point(0, 0);
+ this.panel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ this.panel.Name = "panel";
+ this.panel.Size = new System.Drawing.Size(1031, 40);
+ this.panel.TabIndex = 0;
+ //
+ // buttonToPdf
+ //
+ this.buttonToPdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonToPdf.Location = new System.Drawing.Point(878, 8);
+ this.buttonToPdf.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ this.buttonToPdf.Name = "buttonToPdf";
+ this.buttonToPdf.Size = new System.Drawing.Size(139, 27);
+ this.buttonToPdf.TabIndex = 5;
+ this.buttonToPdf.Text = "В Pdf";
+ this.buttonToPdf.UseVisualStyleBackColor = true;
+ this.buttonToPdf.Click += new System.EventHandler(this.ButtonToPdf_Click);
+ //
+ // buttonMake
+ //
+ this.buttonMake.Location = new System.Drawing.Point(13, 8);
+ this.buttonMake.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ this.buttonMake.Name = "buttonMake";
+ this.buttonMake.Size = new System.Drawing.Size(139, 27);
+ this.buttonMake.TabIndex = 4;
+ this.buttonMake.Text = "Сформировать";
+ this.buttonMake.UseVisualStyleBackColor = true;
+ this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click);
+ //
+ // FormReportGroupOrders
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1031, 647);
+ this.Controls.Add(this.panel);
+ this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ this.Name = "FormReportGroupOrders";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Заказы";
+ this.panel.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel;
+ private System.Windows.Forms.Button buttonToPdf;
+ private System.Windows.Forms.Button buttonMake;
+ }
+}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.resx b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupOrders.resx
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.Designer.cs
new file mode 100644
index 0000000..47d93aa
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.Designer.cs
@@ -0,0 +1,111 @@
+namespace BlacksmithWorkshopView
+{
+ partial class FormReportManufactureComponents
+ {
+ ///
+ /// 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()
+ {
+ this.dataGridView = new System.Windows.Forms.DataGridView();
+ this.buttonSaveToExcel = new System.Windows.Forms.Button();
+ this.ColumnManufacture = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.ColumnComponent = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.ColumnSum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
+ this.SuspendLayout();
+ //
+ // dataGridView
+ //
+ this.dataGridView.AllowUserToAddRows = false;
+ this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
+ this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.ColumnManufacture,
+ this.ColumnComponent,
+ this.ColumnCount,
+ this.ColumnSum});
+ this.dataGridView.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.dataGridView.Location = new System.Drawing.Point(0, 45);
+ this.dataGridView.Name = "dataGridView";
+ this.dataGridView.RowTemplate.Height = 25;
+ this.dataGridView.Size = new System.Drawing.Size(610, 405);
+ this.dataGridView.TabIndex = 0;
+ //
+ // buttonSaveToExcel
+ //
+ this.buttonSaveToExcel.Location = new System.Drawing.Point(12, 12);
+ this.buttonSaveToExcel.Name = "buttonSaveToExcel";
+ this.buttonSaveToExcel.Size = new System.Drawing.Size(188, 23);
+ this.buttonSaveToExcel.TabIndex = 1;
+ this.buttonSaveToExcel.Text = "Сохранить в Excel";
+ this.buttonSaveToExcel.UseVisualStyleBackColor = true;
+ this.buttonSaveToExcel.Click += new System.EventHandler(this.ButtonSaveToExcel_Click);
+ //
+ // ColumnManufacture
+ //
+ this.ColumnManufacture.HeaderText = "Изделие";
+ this.ColumnManufacture.Name = "ColumnManufacture";
+ //
+ // ColumnComponent
+ //
+ this.ColumnComponent.HeaderText = "Компонент";
+ this.ColumnComponent.Name = "ColumnComponent";
+ //
+ // ColumnCount
+ //
+ this.ColumnCount.HeaderText = "Количество";
+ this.ColumnCount.Name = "ColumnCount";
+ //
+ // ColumnSum
+ //
+ this.ColumnSum.HeaderText = "Сумма";
+ this.ColumnSum.Name = "ColumnSum";
+ //
+ // FormReportManufactureComponents
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(610, 450);
+ this.Controls.Add(this.buttonSaveToExcel);
+ this.Controls.Add(this.dataGridView);
+ this.Name = "FormReportManufactureComponents";
+ this.Text = "FormReportManufactureComponents";
+ this.Load += new System.EventHandler(this.FormReportManufactureComponents_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private DataGridView dataGridView;
+ private Button buttonSaveToExcel;
+ private DataGridViewTextBoxColumn ColumnManufacture;
+ private DataGridViewTextBoxColumn ColumnComponent;
+ private DataGridViewTextBoxColumn ColumnCount;
+ private DataGridViewTextBoxColumn ColumnSum;
+ }
+}
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.cs
new file mode 100644
index 0000000..9eeda51
--- /dev/null
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportManufactureComponents.cs
@@ -0,0 +1,71 @@
+using BlacksmithWorkshopContracts.BindingModels;
+using BlacksmithWorkshopContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+
+namespace BlacksmithWorkshopView
+{
+ public partial class FormReportManufactureComponents : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+ public FormReportManufactureComponents(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ }
+ private void FormReportManufactureComponents_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var dict = _logic.GetManufactureComponent();
+ if (dict != null)
+ {
+ dataGridView.Rows.Clear();
+ foreach (var elem in dict)
+ {
+ dataGridView.Rows.Add(new object[] { elem.ManufactureName, "", "" });
+ foreach (var listElem in elem.Components)
+ {
+ dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2, listElem.Item3 });
+ }
+ dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount, elem.TotalSum });
+ dataGridView.Rows.Add(Array.Empty