diff --git a/TravelCompany/TravelCompany.sln b/TravelCompany/TravelCompany.sln
index d976e68..75b6bca 100644
--- a/TravelCompany/TravelCompany.sln
+++ b/TravelCompany/TravelCompany.sln
@@ -19,50 +19,88 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplem
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyClientApp", "TravelCompanyClientApp\TravelCompanyClientApp.csproj", "{F1E802C4-EE5D-4508-B42F-3ACB70621013}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelCompanyRestApi", "TravelCompanyRestApi\TravelCompanyRestApi.csproj", "{E24D011F-7289-4DBA-9C90-D49713C4E495}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyRestApi", "TravelCompanyRestApi\TravelCompanyRestApi.csproj", "{E24D011F-7289-4DBA-9C90-D49713C4E495}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{32E4B160-CD6F-419E-8436-D0194ED66568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32E4B160-CD6F-419E-8436-D0194ED66568}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {32E4B160-CD6F-419E-8436-D0194ED66568}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {32E4B160-CD6F-419E-8436-D0194ED66568}.Debug|x64.Build.0 = Debug|Any CPU
{32E4B160-CD6F-419E-8436-D0194ED66568}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32E4B160-CD6F-419E-8436-D0194ED66568}.Release|Any CPU.Build.0 = Release|Any CPU
+ {32E4B160-CD6F-419E-8436-D0194ED66568}.Release|x64.ActiveCfg = Release|Any CPU
+ {32E4B160-CD6F-419E-8436-D0194ED66568}.Release|x64.Build.0 = Release|Any CPU
{F44E7E58-0372-42BD-A42C-3F6C498F549D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F44E7E58-0372-42BD-A42C-3F6C498F549D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F44E7E58-0372-42BD-A42C-3F6C498F549D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {F44E7E58-0372-42BD-A42C-3F6C498F549D}.Debug|x64.Build.0 = Debug|Any CPU
{F44E7E58-0372-42BD-A42C-3F6C498F549D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F44E7E58-0372-42BD-A42C-3F6C498F549D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F44E7E58-0372-42BD-A42C-3F6C498F549D}.Release|x64.ActiveCfg = Release|Any CPU
+ {F44E7E58-0372-42BD-A42C-3F6C498F549D}.Release|x64.Build.0 = Release|Any CPU
{0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Debug|x64.Build.0 = Debug|Any CPU
{0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Release|x64.ActiveCfg = Release|Any CPU
+ {0F4C2D1A-DDEC-4D02-A493-06A79EF1926D}.Release|x64.Build.0 = Release|Any CPU
{8171EC22-92EF-4916-BD50-B8D68018F6C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8171EC22-92EF-4916-BD50-B8D68018F6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8171EC22-92EF-4916-BD50-B8D68018F6C2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8171EC22-92EF-4916-BD50-B8D68018F6C2}.Debug|x64.Build.0 = Debug|Any CPU
{8171EC22-92EF-4916-BD50-B8D68018F6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8171EC22-92EF-4916-BD50-B8D68018F6C2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8171EC22-92EF-4916-BD50-B8D68018F6C2}.Release|x64.ActiveCfg = Release|Any CPU
+ {8171EC22-92EF-4916-BD50-B8D68018F6C2}.Release|x64.Build.0 = Release|Any CPU
{46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Debug|x64.Build.0 = Debug|Any CPU
{46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Release|x64.ActiveCfg = Release|Any CPU
+ {46AEB3CA-9FB8-444A-9145-B274C5FBEF6B}.Release|x64.Build.0 = Release|Any CPU
{3684BE6E-B9D1-450E-B450-FCE08421C87B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3684BE6E-B9D1-450E-B450-FCE08421C87B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3684BE6E-B9D1-450E-B450-FCE08421C87B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3684BE6E-B9D1-450E-B450-FCE08421C87B}.Debug|x64.Build.0 = Debug|Any CPU
{3684BE6E-B9D1-450E-B450-FCE08421C87B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3684BE6E-B9D1-450E-B450-FCE08421C87B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3684BE6E-B9D1-450E-B450-FCE08421C87B}.Release|x64.ActiveCfg = Release|Any CPU
+ {3684BE6E-B9D1-450E-B450-FCE08421C87B}.Release|x64.Build.0 = Release|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Debug|x64.Build.0 = Debug|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|x64.ActiveCfg = Release|Any CPU
+ {1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|x64.Build.0 = Release|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|x64.Build.0 = Debug|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|x64.ActiveCfg = Release|Any CPU
+ {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|x64.Build.0 = Release|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|x64.Build.0 = Debug|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|x64.ActiveCfg = Release|Any CPU
+ {E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/TravelCompany/TravelCompany/FormCreateSupply.Designer.cs b/TravelCompany/TravelCompany/FormCreateSupply.Designer.cs
new file mode 100644
index 0000000..d7bebf1
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormCreateSupply.Designer.cs
@@ -0,0 +1,143 @@
+namespace TravelCompany.Forms
+{
+ partial class FormCreateSupply
+ {
+ ///
+ /// 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.comboBoxShop = new System.Windows.Forms.ComboBox();
+ this.labelShop = new System.Windows.Forms.Label();
+ this.labelTravel = new System.Windows.Forms.Label();
+ this.comboBoxTravel = new System.Windows.Forms.ComboBox();
+ this.labelCount = new System.Windows.Forms.Label();
+ this.textBoxCount = new System.Windows.Forms.TextBox();
+ this.buttonCancel = new System.Windows.Forms.Button();
+ this.buttonSave = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // comboBoxShop
+ //
+ this.comboBoxShop.FormattingEnabled = true;
+ this.comboBoxShop.Location = new System.Drawing.Point(115, 12);
+ this.comboBoxShop.Name = "comboBoxShop";
+ this.comboBoxShop.Size = new System.Drawing.Size(344, 28);
+ this.comboBoxShop.TabIndex = 0;
+ //
+ // labelShop
+ //
+ this.labelShop.AutoSize = true;
+ this.labelShop.Location = new System.Drawing.Point(12, 15);
+ this.labelShop.Name = "labelShop";
+ this.labelShop.Size = new System.Drawing.Size(76, 20);
+ this.labelShop.TabIndex = 1;
+ this.labelShop.Text = "Магазин: ";
+ //
+ // labelTravel
+ //
+ this.labelTravel.AutoSize = true;
+ this.labelTravel.Location = new System.Drawing.Point(12, 49);
+ this.labelTravel.Name = "labelTravel";
+ this.labelTravel.Size = new System.Drawing.Size(75, 20);
+ this.labelTravel.TabIndex = 2;
+ this.labelTravel.Text = "Изделие: ";
+ //
+ // comboBoxTravel
+ //
+ this.comboBoxTravel.FormattingEnabled = true;
+ this.comboBoxTravel.Location = new System.Drawing.Point(115, 46);
+ this.comboBoxTravel.Name = "comboBoxTravel";
+ this.comboBoxTravel.Size = new System.Drawing.Size(344, 28);
+ this.comboBoxTravel.TabIndex = 3;
+ //
+ // labelCount
+ //
+ this.labelCount.AutoSize = true;
+ this.labelCount.Location = new System.Drawing.Point(12, 83);
+ this.labelCount.Name = "labelCount";
+ this.labelCount.Size = new System.Drawing.Size(97, 20);
+ this.labelCount.TabIndex = 4;
+ this.labelCount.Text = "Количество: ";
+ //
+ // textBoxCount
+ //
+ this.textBoxCount.Location = new System.Drawing.Point(115, 80);
+ this.textBoxCount.Name = "textBoxCount";
+ this.textBoxCount.Size = new System.Drawing.Size(344, 27);
+ this.textBoxCount.TabIndex = 5;
+ //
+ // buttonCancel
+ //
+ this.buttonCancel.Location = new System.Drawing.Point(300, 113);
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.Size = new System.Drawing.Size(116, 39);
+ this.buttonCancel.TabIndex = 6;
+ this.buttonCancel.Text = "Отмена";
+ this.buttonCancel.UseVisualStyleBackColor = true;
+ this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
+ //
+ // buttonSave
+ //
+ this.buttonSave.Location = new System.Drawing.Point(168, 113);
+ this.buttonSave.Name = "buttonSave";
+ this.buttonSave.Size = new System.Drawing.Size(116, 39);
+ this.buttonSave.TabIndex = 7;
+ this.buttonSave.Text = "Сохранить";
+ this.buttonSave.UseVisualStyleBackColor = true;
+ this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click);
+ //
+ // FormCreateSupply
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(471, 164);
+ this.Controls.Add(this.buttonSave);
+ this.Controls.Add(this.buttonCancel);
+ this.Controls.Add(this.textBoxCount);
+ this.Controls.Add(this.labelCount);
+ this.Controls.Add(this.comboBoxTravel);
+ this.Controls.Add(this.labelTravel);
+ this.Controls.Add(this.labelShop);
+ this.Controls.Add(this.comboBoxShop);
+ this.Name = "FormCreateSupply";
+ this.Text = "Создание поставки";
+ this.Load += new System.EventHandler(this.FormCreateSupply_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private ComboBox comboBoxShop;
+ private Label labelShop;
+ private Label labelTravel;
+ private ComboBox comboBoxTravel;
+ private Label labelCount;
+ private TextBox textBoxCount;
+ private Button buttonCancel;
+ private Button buttonSave;
+ }
+}
\ No newline at end of file
diff --git a/TravelCompany/TravelCompany/FormCreateSupply.cs b/TravelCompany/TravelCompany/FormCreateSupply.cs
new file mode 100644
index 0000000..6ca4901
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormCreateSupply.cs
@@ -0,0 +1,99 @@
+using Microsoft.Extensions.Logging;
+using TravelCompanyContracts.BindingModels;
+using TravelCompanyContracts.BusinessLogicsContracts;
+using TravelCompanyContracts.ViewModels;
+using System;
+using System.Collections;
+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;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+
+namespace TravelCompany.Forms
+{
+ public partial class FormCreateSupply : Form
+ {
+ private readonly ILogger _logger;
+ private readonly ITravelLogic _logicP;
+ private readonly IShopLogic _logicS;
+ private List _shopList = new List();
+ private List _TravelList = new List();
+
+ public FormCreateSupply(ILogger logger, ITravelLogic logicP, IShopLogic logicS)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logicP = logicP;
+ _logicS = logicS;
+ }
+
+ private void FormCreateSupply_Load(object sender, EventArgs e)
+ {
+ _shopList = _logicS.ReadList(null);
+ _TravelList = _logicP.ReadList(null);
+ if (_shopList != null)
+ {
+ comboBoxShop.DisplayMember = "ShopName";
+ comboBoxShop.ValueMember = "Id";
+ comboBoxShop.DataSource = _shopList;
+ comboBoxShop.SelectedItem = null;
+ _logger.LogInformation("Загрузка магазинов для поставок");
+ }
+ if (_TravelList != null)
+ {
+ comboBoxTravel.DisplayMember = "TravelName";
+ comboBoxTravel.ValueMember = "Id";
+ comboBoxTravel.DataSource = _TravelList;
+ comboBoxTravel.SelectedItem = null;
+ _logger.LogInformation("Загрузка путёвок для поставок");
+ }
+ }
+
+ private void ButtonSave_Click(object sender, EventArgs e)
+ {
+ if (comboBoxShop.SelectedValue == null)
+ {
+ MessageBox.Show("Выберите магазин", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ if (comboBoxTravel.SelectedValue == null)
+ {
+ MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ _logger.LogInformation("Создание поставки");
+ try
+ {
+ var operationResult = _logicS.MakeSupply(new SupplyBindingModel
+ {
+ ShopId = Convert.ToInt32(comboBoxShop.SelectedValue),
+ TravelId = Convert.ToInt32(comboBoxTravel.SelectedValue),
+ Count = Convert.ToInt32(textBoxCount.Text)
+ });
+ if (!operationResult)
+ {
+ throw new Exception("Ошибка при создании поставки. Дополнительная информация в логах.");
+ }
+ MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ DialogResult = DialogResult.OK;
+ Close();
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка создания поставки");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void ButtonCancel_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.Cancel;
+ Close();
+ }
+ }
+}
diff --git a/TravelCompany/TravelCompany/FormCreateSupply.resx b/TravelCompany/TravelCompany/FormCreateSupply.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormCreateSupply.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/TravelCompany/TravelCompany/FormMain.Designer.cs b/TravelCompany/TravelCompany/FormMain.Designer.cs
index 3d1f849..b1143c3 100644
--- a/TravelCompany/TravelCompany/FormMain.Designer.cs
+++ b/TravelCompany/TravelCompany/FormMain.Designer.cs
@@ -34,10 +34,7 @@
компонентыToolStripMenuItem = new ToolStripMenuItem();
ПутёвкиToolStripMenuItem = new ToolStripMenuItem();
клиентыToolStripMenuItem = new ToolStripMenuItem();
- отчетыToolStripMenuItem = new ToolStripMenuItem();
- списокКомпонентовToolStripMenuItem = new ToolStripMenuItem();
- компонентыПоПутёвкамToolStripMenuItem = new ToolStripMenuItem();
- списокЗаказовToolStripMenuItem = new ToolStripMenuItem();
+ исполнителиToolStripMenuItem = new ToolStripMenuItem();
запускРаботToolStripMenuItem = new ToolStripMenuItem();
buttonCreateOrder = new Button();
buttonTakeOrderInWork = new Button();
@@ -45,7 +42,20 @@
buttonIssuedOrder = new Button();
buttonRef = new Button();
dataGridView = new DataGridView();
- исполнителиToolStripMenuItem = new ToolStripMenuItem();
+ отчётыToolStripMenuItem = new ToolStripMenuItem();
+ изделияToolStripMenuItem = new ToolStripMenuItem();
+ списокИзделийToolStripMenuItem = new ToolStripMenuItem();
+ пиццаСИнгридиентамиToolStripMenuItem = new ToolStripMenuItem();
+ магазинToolStripMenuItem = new ToolStripMenuItem();
+ информацияToolStripMenuItem = new ToolStripMenuItem();
+ загруженностьToolStripMenuItem = new ToolStripMenuItem();
+ заказыToolStripMenuItem = new ToolStripMenuItem();
+ заказыToolStripMenuItem1 = new ToolStripMenuItem();
+ заказыПоГруппамToolStripMenuItem = new ToolStripMenuItem();
+ магазиныToolStripMenuItem = new ToolStripMenuItem();
+ operationToolStripMenuItem = new ToolStripMenuItem();
+ transactionToolStripMenuItem = new ToolStripMenuItem();
+ продажаToolStripMenuItem = new ToolStripMenuItem();
toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
@@ -53,7 +63,7 @@
// toolStrip1
//
toolStrip1.ImageScalingSize = new Size(20, 20);
- toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, отчетыToolStripMenuItem, запускРаботToolStripMenuItem });
+ toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, operationToolStripMenuItem, отчётыToolStripMenuItem, запускРаботToolStripMenuItem });
toolStrip1.Location = new Point(0, 0);
toolStrip1.Name = "toolStrip1";
toolStrip1.Size = new Size(969, 25);
@@ -63,7 +73,7 @@
// toolStripDropDownButton1
//
toolStripDropDownButton1.DisplayStyle = ToolStripItemDisplayStyle.Text;
- toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, ПутёвкиToolStripMenuItem, клиентыToolStripMenuItem, исполнителиToolStripMenuItem });
+ toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, ПутёвкиToolStripMenuItem, клиентыToolStripMenuItem, исполнителиToolStripMenuItem, магазиныToolStripMenuItem });
toolStripDropDownButton1.Image = (Image)resources.GetObject("toolStripDropDownButton1.Image");
toolStripDropDownButton1.ImageTransparentColor = Color.Magenta;
toolStripDropDownButton1.Name = "toolStripDropDownButton1";
@@ -91,33 +101,12 @@
клиентыToolStripMenuItem.Text = "Клиенты";
клиентыToolStripMenuItem.Click += клиентыToolStripMenuItem_Click;
//
- // отчетыToolStripMenuItem
+ // исполнителиToolStripMenuItem
//
- отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокКомпонентовToolStripMenuItem, компонентыПоПутёвкамToolStripMenuItem, списокЗаказовToolStripMenuItem });
- отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
- отчетыToolStripMenuItem.Size = new Size(60, 25);
- отчетыToolStripMenuItem.Text = "Отчеты";
- //
- // списокКомпонентовToolStripMenuItem
- //
- списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem";
- списокКомпонентовToolStripMenuItem.Size = new Size(216, 22);
- списокКомпонентовToolStripMenuItem.Text = "Список компонентов";
- списокКомпонентовToolStripMenuItem.Click += списокКомпонентовToolStripMenuItem_Click;
- //
- // компонентыПоПутёвкамToolStripMenuItem
- //
- компонентыПоПутёвкамToolStripMenuItem.Name = "компонентыПоПутёвкамToolStripMenuItem";
- компонентыПоПутёвкамToolStripMenuItem.Size = new Size(216, 22);
- компонентыПоПутёвкамToolStripMenuItem.Text = "Компоненты по путёвкам";
- компонентыПоПутёвкамToolStripMenuItem.Click += компонентыПоПутёвкамToolStripMenuItem_Click;
- //
- // списокЗаказовToolStripMenuItem
- //
- списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
- списокЗаказовToolStripMenuItem.Size = new Size(216, 22);
- списокЗаказовToolStripMenuItem.Text = "Список заказов";
- списокЗаказовToolStripMenuItem.Click += списокЗаказовToolStripMenuItem_Click;
+ исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem";
+ исполнителиToolStripMenuItem.Size = new Size(180, 22);
+ исполнителиToolStripMenuItem.Text = "Исполнители";
+ исполнителиToolStripMenuItem.Click += исполнителиToolStripMenuItem_Click;
//
// запускРаботToolStripMenuItem
//
@@ -188,12 +177,103 @@
dataGridView.Size = new Size(763, 435);
dataGridView.TabIndex = 6;
//
- // исполнителиToolStripMenuItem
+ // отчётыToolStripMenuItem
//
- исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem";
- исполнителиToolStripMenuItem.Size = new Size(180, 22);
- исполнителиToolStripMenuItem.Text = "Исполнители";
- исполнителиToolStripMenuItem.Click += исполнителиToolStripMenuItem_Click;
+ отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { изделияToolStripMenuItem, магазинToolStripMenuItem, заказыToolStripMenuItem });
+ отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
+ отчётыToolStripMenuItem.Size = new Size(60, 25);
+ отчётыToolStripMenuItem.Text = "Отчёты";
+ //
+ // изделияToolStripMenuItem
+ //
+ изделияToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокИзделийToolStripMenuItem, пиццаСИнгридиентамиToolStripMenuItem });
+ изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
+ изделияToolStripMenuItem.Size = new Size(180, 22);
+ изделияToolStripMenuItem.Text = "Путевки";
+ //
+ // списокИзделийToolStripMenuItem
+ //
+ списокИзделийToolStripMenuItem.Name = "списокИзделийToolStripMenuItem";
+ списокИзделийToolStripMenuItem.Size = new Size(213, 22);
+ списокИзделийToolStripMenuItem.Text = "Список путевок";
+ списокИзделийToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click;
+ //
+ // пиццаСИнгридиентамиToolStripMenuItem
+ //
+ пиццаСИнгридиентамиToolStripMenuItem.Name = "пиццаСИнгридиентамиToolStripMenuItem";
+ пиццаСИнгридиентамиToolStripMenuItem.Size = new Size(213, 22);
+ пиццаСИнгридиентамиToolStripMenuItem.Text = "Путевка с компонентами";
+ пиццаСИнгридиентамиToolStripMenuItem.Click += ComponentTravelToolStripMenuItem_Click;
+ //
+ // магазинToolStripMenuItem
+ //
+ магазинToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { информацияToolStripMenuItem, загруженностьToolStripMenuItem });
+ магазинToolStripMenuItem.Name = "магазинToolStripMenuItem";
+ магазинToolStripMenuItem.Size = new Size(180, 22);
+ магазинToolStripMenuItem.Text = "Магазин";
+ //
+ // информацияToolStripMenuItem
+ //
+ информацияToolStripMenuItem.Name = "информацияToolStripMenuItem";
+ информацияToolStripMenuItem.Size = new Size(180, 22);
+ информацияToolStripMenuItem.Text = "Информация";
+ информацияToolStripMenuItem.Click += InfoToolStripMenuItem_Click;
+ //
+ // загруженностьToolStripMenuItem
+ //
+ загруженностьToolStripMenuItem.Name = "загруженностьToolStripMenuItem";
+ загруженностьToolStripMenuItem.Size = new Size(180, 22);
+ загруженностьToolStripMenuItem.Text = "Загруженность";
+ загруженностьToolStripMenuItem.Click += BusyShopsToolStripMenuItem_Click;
+ //
+ // заказыToolStripMenuItem
+ //
+ заказыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { заказыToolStripMenuItem1, заказыПоГруппамToolStripMenuItem });
+ заказыToolStripMenuItem.Name = "заказыToolStripMenuItem";
+ заказыToolStripMenuItem.Size = new Size(180, 22);
+ заказыToolStripMenuItem.Text = "Заказы";
+ //
+ // заказыToolStripMenuItem1
+ //
+ заказыToolStripMenuItem1.Name = "заказыToolStripMenuItem1";
+ заказыToolStripMenuItem1.Size = new Size(180, 22);
+ заказыToolStripMenuItem1.Text = "Заказы";
+ заказыToolStripMenuItem1.Click += OrdersToolStripMenuItem_Click;
+ //
+ // заказыПоГруппамToolStripMenuItem
+ //
+ заказыПоГруппамToolStripMenuItem.Name = "заказыПоГруппамToolStripMenuItem";
+ заказыПоГруппамToolStripMenuItem.Size = new Size(180, 22);
+ заказыПоГруппамToolStripMenuItem.Text = "Заказы по группам";
+ заказыПоГруппамToolStripMenuItem.Click += GroupOrdersToolStripMenuItem_Click;
+ //
+ // магазиныToolStripMenuItem
+ //
+ магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem";
+ магазиныToolStripMenuItem.Size = new Size(180, 22);
+ магазиныToolStripMenuItem.Text = "Магазины";
+ магазиныToolStripMenuItem.Click += shopsToolStripMenuItem_Click;
+ //
+ // operationToolStripMenuItem
+ //
+ operationToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { transactionToolStripMenuItem, продажаToolStripMenuItem });
+ operationToolStripMenuItem.Name = "operationToolStripMenuItem";
+ operationToolStripMenuItem.Size = new Size(75, 25);
+ operationToolStripMenuItem.Text = "Операции";
+ //
+ // transactionToolStripMenuItem
+ //
+ transactionToolStripMenuItem.Name = "transactionToolStripMenuItem";
+ transactionToolStripMenuItem.Size = new Size(180, 22);
+ transactionToolStripMenuItem.Text = "Поставка";
+ transactionToolStripMenuItem.Click += transactionToolStripMenuItem_Click;
+ //
+ // продажаToolStripMenuItem
+ //
+ продажаToolStripMenuItem.Name = "продажаToolStripMenuItem";
+ продажаToolStripMenuItem.Size = new Size(180, 22);
+ продажаToolStripMenuItem.Text = "Продажа";
+ продажаToolStripMenuItem.Click += SellToolStripMenuItem_Click;
//
// FormMain
//
@@ -229,12 +309,22 @@
private ToolStripDropDownButton toolStripDropDownButton1;
private ToolStripMenuItem компонентыToolStripMenuItem;
private ToolStripMenuItem ПутёвкиToolStripMenuItem;
- private ToolStripMenuItem отчетыToolStripMenuItem;
- private ToolStripMenuItem списокКомпонентовToolStripMenuItem;
- private ToolStripMenuItem компонентыПоПутёвкамToolStripMenuItem;
- private ToolStripMenuItem списокЗаказовToolStripMenuItem;
private ToolStripMenuItem клиентыToolStripMenuItem;
private ToolStripMenuItem запускРаботToolStripMenuItem;
private ToolStripMenuItem исполнителиToolStripMenuItem;
+ private ToolStripMenuItem магазиныToolStripMenuItem;
+ private ToolStripMenuItem operationToolStripMenuItem;
+ private ToolStripMenuItem transactionToolStripMenuItem;
+ private ToolStripMenuItem продажаToolStripMenuItem;
+ private ToolStripMenuItem отчётыToolStripMenuItem;
+ private ToolStripMenuItem изделияToolStripMenuItem;
+ private ToolStripMenuItem списокИзделийToolStripMenuItem;
+ private ToolStripMenuItem пиццаСИнгридиентамиToolStripMenuItem;
+ private ToolStripMenuItem магазинToolStripMenuItem;
+ private ToolStripMenuItem информацияToolStripMenuItem;
+ private ToolStripMenuItem загруженностьToolStripMenuItem;
+ private ToolStripMenuItem заказыToolStripMenuItem;
+ private ToolStripMenuItem заказыToolStripMenuItem1;
+ private ToolStripMenuItem заказыПоГруппамToolStripMenuItem;
}
}
\ No newline at end of file
diff --git a/TravelCompany/TravelCompany/FormMain.cs b/TravelCompany/TravelCompany/FormMain.cs
index 42be528..5ce3362 100644
--- a/TravelCompany/TravelCompany/FormMain.cs
+++ b/TravelCompany/TravelCompany/FormMain.cs
@@ -220,5 +220,95 @@ Program.ServiceProvider?.GetService(typeof(ImplementersForm));
form.ShowDialog();
}
}
+
+ private void shopsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormShops));
+ if (service is FormShops form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void transactionToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormCreateSupply));
+ if (service is FormCreateSupply form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void SellToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormSellTravels));
+ if (service is FormSellTravels form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void ComponentsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveTravelsToWordFile(new ReportBindingModel { FileName = dialog.FileName });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+
+ }
+
+ private void ComponentTravelToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportTravelComponents));
+ if (service is FormReportTravelComponents form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void InfoToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private void BusyShopsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportShop));
+ if (service is FormReportShop form)
+ {
+ form.ShowDialog();
+ }
+ }
+
+ private void OrdersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
+ if (service is FormReportOrders form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void GroupOrdersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders));
+ if (service is FormReportGroupedOrders form)
+ {
+ form.ShowDialog();
+ }
+
+ }
}
}
diff --git a/TravelCompany/TravelCompany/FormReportGroupedOrders.Designer.cs b/TravelCompany/TravelCompany/FormReportGroupedOrders.Designer.cs
new file mode 100644
index 0000000..b5d86a8
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormReportGroupedOrders.Designer.cs
@@ -0,0 +1,86 @@
+namespace TravelCompany.Forms
+{
+ partial class FormReportGroupedOrders
+ {
+ ///
+ /// 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.Name = "panel";
+ this.panel.Size = new System.Drawing.Size(970, 52);
+ this.panel.TabIndex = 1;
+ //
+ // buttonToPDF
+ //
+ this.buttonToPDF.Location = new System.Drawing.Point(486, 12);
+ this.buttonToPDF.Name = "buttonToPDF";
+ this.buttonToPDF.Size = new System.Drawing.Size(411, 29);
+ 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(49, 12);
+ this.buttonMake.Name = "buttonMake";
+ this.buttonMake.Size = new System.Drawing.Size(377, 29);
+ this.buttonMake.TabIndex = 4;
+ this.buttonMake.Text = "Сформировать";
+ this.buttonMake.UseVisualStyleBackColor = true;
+ this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click);
+ //
+ // FormReportGroupedOrders
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(970, 450);
+ this.Controls.Add(this.panel);
+ this.Name = "FormReportGroupedOrders";
+ this.Text = "Отчёт по группированным заказам ";
+ this.panel.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Panel panel;
+ private Button buttonToPDF;
+ private Button buttonMake;
+ }
+}
\ No newline at end of file
diff --git a/TravelCompany/TravelCompany/FormReportGroupedOrders.cs b/TravelCompany/TravelCompany/FormReportGroupedOrders.cs
new file mode 100644
index 0000000..2ed78e6
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormReportGroupedOrders.cs
@@ -0,0 +1,80 @@
+using Microsoft.Extensions.Logging;
+using Microsoft.Reporting.WinForms;
+using TravelCompanyContracts.BindingModels;
+using TravelCompanyContracts.BusinessLogicsContracts;
+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 TravelCompany.Forms
+{
+ public partial class FormReportGroupedOrders : Form
+ {
+ private readonly ReportViewer reportViewer;
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+
+ public FormReportGroupedOrders(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ reportViewer = new ReportViewer
+ {
+ Dock = DockStyle.Fill
+ };
+ reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\goldfest\\Desktop\\RPP\\TravelCompany\\TravelCompany\\ReportGroupedOrders.rdlc", FileMode.Open));
+ Controls.Clear();
+ Controls.Add(reportViewer);
+ Controls.Add(panel);
+ }
+
+ private void ButtonMake_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ var dataSource = _logic.GetGroupedOrders();
+ var source = new ReportDataSource("DataSetGroupedOrders", dataSource);
+ reportViewer.LocalReport.DataSources.Clear();
+ reportViewer.LocalReport.DataSources.Add(source);
+
+ reportViewer.RefreshReport();
+ _logger.LogInformation("Загрузка списка группированных заказов");
+ }
+ 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.SaveGroupedOrdersToPdfFile(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);
+ }
+ }
+ }
+ }
+}
diff --git a/TravelCompany/TravelCompany/FormReportGroupedOrders.resx b/TravelCompany/TravelCompany/FormReportGroupedOrders.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormReportGroupedOrders.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/TravelCompany/TravelCompany/FormReportShop.Designer.cs b/TravelCompany/TravelCompany/FormReportShop.Designer.cs
new file mode 100644
index 0000000..20e0caa
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormReportShop.Designer.cs
@@ -0,0 +1,115 @@
+namespace TravelCompany.Forms
+{
+ partial class FormReportShop
+ {
+ ///
+ /// 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();
+ ColumnShop = new DataGridViewTextBoxColumn();
+ ColumnTravel = new DataGridViewTextBoxColumn();
+ ColumnCount = new DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
+ SuspendLayout();
+ //
+ // buttonSaveToExcel
+ //
+ buttonSaveToExcel.Location = new Point(0, 4);
+ buttonSaveToExcel.Margin = new Padding(3, 2, 3, 2);
+ buttonSaveToExcel.Name = "buttonSaveToExcel";
+ buttonSaveToExcel.Size = new Size(195, 22);
+ buttonSaveToExcel.TabIndex = 3;
+ buttonSaveToExcel.Text = "Сохранить в Excel";
+ buttonSaveToExcel.UseVisualStyleBackColor = true;
+ buttonSaveToExcel.Click += ButtonSaveToExcel_Click;
+ //
+ // dataGridView
+ //
+ dataGridView.AllowUserToAddRows = false;
+ dataGridView.AllowUserToDeleteRows = false;
+ dataGridView.AllowUserToOrderColumns = true;
+ dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
+ dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnShop, ColumnTravel, 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(523, 302);
+ dataGridView.TabIndex = 2;
+ //
+ // ColumnShop
+ //
+ ColumnShop.FillWeight = 130F;
+ ColumnShop.HeaderText = "Магазин";
+ ColumnShop.MinimumWidth = 6;
+ ColumnShop.Name = "ColumnShop";
+ ColumnShop.ReadOnly = true;
+ //
+ // ColumnTravel
+ //
+ ColumnTravel.FillWeight = 140F;
+ ColumnTravel.HeaderText = "Путевка";
+ ColumnTravel.MinimumWidth = 6;
+ ColumnTravel.Name = "ColumnTravel";
+ ColumnTravel.ReadOnly = true;
+ //
+ // ColumnCount
+ //
+ ColumnCount.FillWeight = 90F;
+ ColumnCount.HeaderText = "Количество";
+ ColumnCount.MinimumWidth = 6;
+ ColumnCount.Name = "ColumnCount";
+ ColumnCount.ReadOnly = true;
+ //
+ // FormReportShop
+ //
+ AutoScaleDimensions = new SizeF(7F, 15F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(523, 338);
+ Controls.Add(buttonSaveToExcel);
+ Controls.Add(dataGridView);
+ Margin = new Padding(3, 2, 3, 2);
+ Name = "FormReportShop";
+ Text = "Наполненость магазинов";
+ Load += FormReportShop_Load;
+ ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Button buttonSaveToExcel;
+ private DataGridView dataGridView;
+ private DataGridViewTextBoxColumn ColumnShop;
+ private DataGridViewTextBoxColumn ColumnTravel;
+ private DataGridViewTextBoxColumn ColumnCount;
+ }
+}
\ No newline at end of file
diff --git a/TravelCompany/TravelCompany/FormReportShop.cs b/TravelCompany/TravelCompany/FormReportShop.cs
new file mode 100644
index 0000000..72b252c
--- /dev/null
+++ b/TravelCompany/TravelCompany/FormReportShop.cs
@@ -0,0 +1,78 @@
+using Microsoft.Extensions.Logging;
+using TravelCompanyContracts.BindingModels;
+using TravelCompanyContracts.BusinessLogicsContracts;
+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 TravelCompany.Forms
+{
+ public partial class FormReportShop : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+
+ public FormReportShop(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ }
+
+ private void FormReportShop_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var dict = _logic.GetShops();
+ if (dict != null)
+ {
+ dataGridView.Rows.Clear();
+ foreach (var elem in dict)
+ {
+ dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" });
+ foreach (var listElem in elem.Travels)
+ {
+ dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
+ }
+ dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount });
+ dataGridView.Rows.Add(Array.Empty