diff --git a/AutoWorkshopView/AutoWorkshopView.csproj b/AutoWorkshopView/AutoWorkshopView.csproj
index 49bf415..81392a9 100644
--- a/AutoWorkshopView/AutoWorkshopView.csproj
+++ b/AutoWorkshopView/AutoWorkshopView.csproj
@@ -18,6 +18,7 @@
+
\ No newline at end of file
diff --git a/AutoWorkshopView/Forms/FormReportOrders.Designer.cs b/AutoWorkshopView/Forms/FormReportOrders.Designer.cs
new file mode 100644
index 0000000..27a6825
--- /dev/null
+++ b/AutoWorkshopView/Forms/FormReportOrders.Designer.cs
@@ -0,0 +1,136 @@
+namespace AutoWorkshopView.Forms
+{
+ partial class FormReportOrders
+ {
+ ///
+ /// 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()
+ {
+ Panel = new Panel();
+ ToPdfButton = new Button();
+ CreateButton = new Button();
+ ToDateTimePicker = new DateTimePicker();
+ ToLabel = new Label();
+ FromDateTimePicker = new DateTimePicker();
+ FromLabel = new Label();
+ Panel.SuspendLayout();
+ SuspendLayout();
+ //
+ // panel
+ //
+ Panel.Controls.Add(ToPdfButton);
+ Panel.Controls.Add(CreateButton);
+ Panel.Controls.Add(ToDateTimePicker);
+ Panel.Controls.Add(ToLabel);
+ Panel.Controls.Add(FromDateTimePicker);
+ Panel.Controls.Add(FromLabel);
+ Panel.Dock = DockStyle.Top;
+ Panel.Location = new Point(0, 0);
+ Panel.Margin = new Padding(3, 2, 3, 2);
+ Panel.Name = "Panel";
+ Panel.Size = new Size(838, 39);
+ Panel.TabIndex = 0;
+ //
+ // ToPdfButton
+ //
+ ToPdfButton.Location = new Point(683, 7);
+ ToPdfButton.Margin = new Padding(3, 2, 3, 2);
+ ToPdfButton.Name = "ToPdfButton";
+ ToPdfButton.Size = new Size(144, 22);
+ ToPdfButton.TabIndex = 5;
+ ToPdfButton.Text = "В PDF";
+ ToPdfButton.UseVisualStyleBackColor = true;
+ ToPdfButton.Click += ButtonToPdf_Click;
+ //
+ // CreateButton
+ //
+ CreateButton.Location = new Point(474, 8);
+ CreateButton.Margin = new Padding(3, 2, 3, 2);
+ CreateButton.Name = "CreateButton";
+ CreateButton.Size = new Size(144, 22);
+ CreateButton.TabIndex = 4;
+ CreateButton.Text = "Сформировать";
+ CreateButton.UseVisualStyleBackColor = true;
+ CreateButton.Click += ButtonMake_Click;
+ //
+ // ToDateTimePicker
+ //
+ ToDateTimePicker.Location = new Point(262, 7);
+ ToDateTimePicker.Margin = new Padding(3, 2, 3, 2);
+ ToDateTimePicker.Name = "ToDateTimePicker";
+ ToDateTimePicker.Size = new Size(175, 23);
+ ToDateTimePicker.TabIndex = 3;
+ //
+ // ToLabel
+ //
+ ToLabel.AutoSize = true;
+ ToLabel.Location = new Point(222, 10);
+ ToLabel.Name = "ToLabel";
+ ToLabel.Size = new Size(21, 15);
+ ToLabel.TabIndex = 2;
+ ToLabel.Text = "по";
+ //
+ // FromDateTimePicker
+ //
+ FromDateTimePicker.Location = new Point(32, 7);
+ FromDateTimePicker.Margin = new Padding(3, 2, 3, 2);
+ FromDateTimePicker.Name = "FromDateTimePicker";
+ FromDateTimePicker.Size = new Size(175, 23);
+ FromDateTimePicker.TabIndex = 1;
+ //
+ // FromLabel
+ //
+ FromLabel.AutoSize = true;
+ FromLabel.Location = new Point(10, 10);
+ FromLabel.Name = "FromLabel";
+ FromLabel.Size = new Size(15, 15);
+ FromLabel.TabIndex = 0;
+ FromLabel.Text = "C";
+ //
+ // FormReportOrders
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(838, 338);
+ Controls.Add(Panel);
+ Margin = new Padding(3, 2, 3, 2);
+ Name = "FormReportOrders";
+ Text = "Заказы";
+ Panel.ResumeLayout(false);
+ Panel.PerformLayout();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Panel Panel;
+ private Button ToPdfButton;
+ private Button CreateButton;
+ private DateTimePicker ToDateTimePicker;
+ private Label ToLabel;
+ private DateTimePicker FromDateTimePicker;
+ private Label FromLabel;
+ }
+}
\ No newline at end of file
diff --git a/AutoWorkshopView/Forms/FormReportOrders.cs b/AutoWorkshopView/Forms/FormReportOrders.cs
new file mode 100644
index 0000000..6723fef
--- /dev/null
+++ b/AutoWorkshopView/Forms/FormReportOrders.cs
@@ -0,0 +1,98 @@
+using AutoWorkshopContracts.BindingModels;
+using AutoWorkshopContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+using Microsoft.Reporting.WinForms;
+
+namespace AutoWorkshopView.Forms
+{
+ public partial class FormReportOrders : Form
+ {
+ private readonly ReportViewer _reportViewer;
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+
+ public FormReportOrders(ILogger Logger, IReportLogic Logic)
+ {
+ InitializeComponent();
+ _logger = Logger;
+ _logic = Logic;
+
+ _reportViewer = new ReportViewer
+ {
+ Dock = DockStyle.Fill
+ };
+ _reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrder.rdlc", FileMode.Open));
+
+ Controls.Clear();
+ Controls.Add(_reportViewer);
+ Controls.Add(Panel);
+ }
+
+ private void ButtonMake_Click(object sender, EventArgs e)
+ {
+ if (FromDateTimePicker.Value.Date >= ToDateTimePicker.Value.Date)
+ {
+ MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ try
+ {
+ var DataSource = _logic.GetOrders(new ReportBindingModel
+ {
+ DateFrom = FromDateTimePicker.Value,
+ DateTo = ToDateTimePicker.Value
+ });
+
+ var Source = new ReportDataSource("DataSetOrders", DataSource);
+
+ _reportViewer.LocalReport.DataSources.Clear();
+ _reportViewer.LocalReport.DataSources.Add(Source);
+
+ var Parameters = new[] { new ReportParameter("ReportParameterPeriod",
+ $"c {FromDateTimePicker.Value.ToShortDateString()} по {ToDateTimePicker.Value.ToShortDateString()}") };
+ _reportViewer.LocalReport.SetParameters(Parameters);
+
+ _reportViewer.RefreshReport();
+ _logger.LogInformation("Загрузка списка заказов на период {From}-{To}", FromDateTimePicker.Value.ToShortDateString(), ToDateTimePicker.Value.ToShortDateString());
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка загрузки списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonToPdf_Click(object sender, EventArgs e)
+ {
+ if (FromDateTimePicker.Value.Date >= ToDateTimePicker.Value.Date)
+ {
+ MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ using var Dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
+
+ if (Dialog.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ _logic.SaveOrdersToPdfFile(new ReportBindingModel
+ {
+ FileName = Dialog.FileName,
+ DateFrom = FromDateTimePicker.Value,
+ DateTo = ToDateTimePicker.Value
+ });
+
+ _logger.LogInformation("Сохранение списка заказов на период {From}-{To}", FromDateTimePicker.Value.ToShortDateString(), ToDateTimePicker.Value.ToShortDateString());
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка сохранения списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ }
+}
diff --git a/AutoWorkshopView/Forms/FormReportOrders.resx b/AutoWorkshopView/Forms/FormReportOrders.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/AutoWorkshopView/Forms/FormReportOrders.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/AutoWorkshopView/Forms/FormReportRepairComponents.Designer.cs b/AutoWorkshopView/Forms/FormReportRepairComponents.Designer.cs
new file mode 100644
index 0000000..7000439
--- /dev/null
+++ b/AutoWorkshopView/Forms/FormReportRepairComponents.Designer.cs
@@ -0,0 +1,115 @@
+namespace AutoWorkshopView.Forms
+{
+ partial class FormReportRepairComponents
+ {
+ ///
+ /// 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()
+ {
+ DataGridView = new DataGridView();
+ ColumnRepair = new DataGridViewTextBoxColumn();
+ ColumnComponent = new DataGridViewTextBoxColumn();
+ ColumnCount = new DataGridViewTextBoxColumn();
+ SaveToExcelButton = new Button();
+ ((System.ComponentModel.ISupportInitialize)DataGridView).BeginInit();
+ SuspendLayout();
+ //
+ // DataGridView
+ //
+ DataGridView.AllowUserToAddRows = false;
+ DataGridView.AllowUserToDeleteRows = false;
+ DataGridView.AllowUserToOrderColumns = true;
+ DataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ DataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ DataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnRepair, ColumnComponent, ColumnCount });
+ DataGridView.Dock = DockStyle.Bottom;
+ DataGridView.Location = new Point(0, 36);
+ DataGridView.Margin = new Padding(3, 2, 3, 2);
+ DataGridView.Name = "DataGridView";
+ DataGridView.ReadOnly = true;
+ DataGridView.RowHeadersWidth = 51;
+ DataGridView.RowTemplate.Height = 29;
+ DataGridView.Size = new Size(494, 302);
+ DataGridView.TabIndex = 0;
+ //
+ // ColumnRepair
+ //
+ ColumnRepair.FillWeight = 130F;
+ ColumnRepair.HeaderText = "Ремонт";
+ ColumnRepair.MinimumWidth = 6;
+ ColumnRepair.Name = "ColumnRepair";
+ ColumnRepair.ReadOnly = true;
+ //
+ // ColumnComponent
+ //
+ ColumnComponent.FillWeight = 140F;
+ ColumnComponent.HeaderText = "Компонент";
+ ColumnComponent.MinimumWidth = 6;
+ ColumnComponent.Name = "ColumnComponent";
+ ColumnComponent.ReadOnly = true;
+ //
+ // ColumnCount
+ //
+ ColumnCount.FillWeight = 90F;
+ ColumnCount.HeaderText = "Количество";
+ ColumnCount.MinimumWidth = 6;
+ ColumnCount.Name = "ColumnCount";
+ ColumnCount.ReadOnly = true;
+ //
+ // SaveToExcelButton
+ //
+ SaveToExcelButton.Location = new Point(12, 10);
+ SaveToExcelButton.Margin = new Padding(3, 2, 3, 2);
+ SaveToExcelButton.Name = "SaveToExcelButton";
+ SaveToExcelButton.Size = new Size(470, 22);
+ SaveToExcelButton.TabIndex = 1;
+ SaveToExcelButton.Text = "Сохранить в Excel";
+ SaveToExcelButton.UseVisualStyleBackColor = true;
+ SaveToExcelButton.Click += ButtonSaveToExcel_Click;
+ //
+ // FormReportRepairComponents
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(494, 338);
+ Controls.Add(SaveToExcelButton);
+ Controls.Add(DataGridView);
+ Margin = new Padding(3, 2, 3, 2);
+ Name = "FormReportRepairComponents";
+ Text = "Ремонт с компонентами";
+ Load += FormReportRepairComponents_Load;
+ ((System.ComponentModel.ISupportInitialize)DataGridView).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private DataGridView DataGridView;
+ private Button SaveToExcelButton;
+ private DataGridViewTextBoxColumn ColumnRepair;
+ private DataGridViewTextBoxColumn ColumnComponent;
+ private DataGridViewTextBoxColumn ColumnCount;
+ }
+}
\ No newline at end of file
diff --git a/AutoWorkshopView/Forms/FormReportRepairComponents.cs b/AutoWorkshopView/Forms/FormReportRepairComponents.cs
new file mode 100644
index 0000000..675d71b
--- /dev/null
+++ b/AutoWorkshopView/Forms/FormReportRepairComponents.cs
@@ -0,0 +1,75 @@
+using AutoWorkshopContracts.BindingModels;
+using AutoWorkshopContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+
+namespace AutoWorkshopView.Forms
+{
+ public partial class FormReportRepairComponents : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+
+ public FormReportRepairComponents(ILogger Logger, IReportLogic Logic)
+ {
+ InitializeComponent();
+
+ _logger = Logger;
+ _logic = Logic;
+ }
+
+ private void FormReportRepairComponents_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var Dict = _logic.GetRepairComponents();
+
+ if (Dict != null)
+ {
+ DataGridView.Rows.Clear();
+
+ foreach (var Elem in Dict)
+ {
+ DataGridView.Rows.Add(new object[] { Elem.RepairName, "", "" });
+
+ 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