diff --git a/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.Designer.cs b/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.Designer.cs
new file mode 100644
index 0000000..d5e8988
--- /dev/null
+++ b/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.Designer.cs
@@ -0,0 +1,101 @@
+namespace PlumbingRepair
+{
+ partial class FormReportWorkComponents
+ {
+ ///
+ /// 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.ButtonSave = new System.Windows.Forms.Button();
+ this.dataGridView = new System.Windows.Forms.DataGridView();
+ this.component = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.work = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.count = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
+ this.SuspendLayout();
+ //
+ // ButtonSave
+ //
+ this.ButtonSave.Location = new System.Drawing.Point(12, 12);
+ this.ButtonSave.Name = "ButtonSave";
+ this.ButtonSave.Size = new System.Drawing.Size(155, 23);
+ this.ButtonSave.TabIndex = 0;
+ this.ButtonSave.Text = "Сохранить в Excel";
+ this.ButtonSave.UseVisualStyleBackColor = true;
+ this.ButtonSave.Click += new System.EventHandler(this.ButtonSave_Click);
+ //
+ // dataGridView
+ //
+ this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.component,
+ this.work,
+ this.count});
+ this.dataGridView.Location = new System.Drawing.Point(12, 41);
+ this.dataGridView.Name = "dataGridView";
+ this.dataGridView.RowTemplate.Height = 25;
+ this.dataGridView.Size = new System.Drawing.Size(776, 397);
+ this.dataGridView.TabIndex = 1;
+ //
+ // component
+ //
+ this.component.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+ this.component.HeaderText = "Компонент";
+ this.component.Name = "component";
+ //
+ // sushi
+ //
+ this.work.HeaderText = "Изделие";
+ this.work.Name = "work";
+ //
+ // count
+ //
+ this.count.HeaderText = "Количество";
+ this.count.Name = "count";
+ //
+ // FormComponentsOnSushi
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.dataGridView);
+ this.Controls.Add(this.ButtonSave);
+ this.Name = "FormReportWorkComponents";
+ this.Text = "Изделия по компонентам";
+ this.Load += new System.EventHandler(this.FormReportWorkComponents_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Button ButtonSave;
+ private DataGridView dataGridView;
+ private DataGridViewTextBoxColumn component;
+ private DataGridViewTextBoxColumn work;
+ private DataGridViewTextBoxColumn count;
+ }
+}
\ No newline at end of file
diff --git a/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.cs b/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.cs
new file mode 100644
index 0000000..f6ba407
--- /dev/null
+++ b/PlumbingRepair/PlumbingRepair/FormReportWorkComponents.cs
@@ -0,0 +1,78 @@
+using Microsoft.Extensions.Logging;
+using PlumbingRepairContracts.BindingModels;
+using PlumbingRepairContracts.BusinessLogicsContracts;
+
+
+namespace PlumbingRepair
+{
+ public partial class FormReportWorkComponents : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+
+ public FormReportWorkComponents(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ }
+
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog
+ {
+ Filter = "xlsx|*.xlsx"
+ };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ _logic.SaveWorkComponentToExcelFile(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);
+ }
+ }
+
+ }
+
+ private void FormReportWorkComponents_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var dict = _logic.GetWork();
+ if (dict != null)
+ {
+ dataGridView.Rows.Clear();
+ foreach (var elem in dict)
+ {
+ dataGridView.Rows.Add(new object[] { elem.WorkName, "", "" });
+ foreach (var listElem in elem.Components)
+ {
+ dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
+ }
+ dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount });
+ dataGridView.Rows.Add(Array.Empty