From fa05cb1b6d8f9419f0a7a6149a736381785f7fda Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Fri, 21 Apr 2023 00:09:37 +0400 Subject: [PATCH] some errors fixed --- .../BusinessLogic/ReportLogic.cs | 6 +-- .../SoftwareInstallation/FormMain.Designer.cs | 48 +++++++++-------- .../SoftwareInstallation/FormMain.cs | 2 +- .../FormReportPackageSoftwares.Designer.cs | 53 ++++++++++--------- .../FormReportPackageSoftwares.cs | 6 +-- .../FormReportPackageSoftwares.resx | 4 +- .../SoftwareInstallation/Program.cs | 4 +- .../SoftwareInstallationView.csproj | 1 + 8 files changed, 67 insertions(+), 57 deletions(-) diff --git a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ReportLogic.cs b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ReportLogic.cs index b1e973e..eed4140 100644 --- a/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/SoftwareInstallation/AbstractSoftwareInstallationBusinessLogic/BusinessLogic/ReportLogic.cs @@ -43,10 +43,10 @@ namespace AbstractSoftwareInstallationBusinessLogic.BusinessLogic Softwares = new List<(string Blank, int Count)>(), TotalCount = 0 }; - foreach (var blank in doc.PackageSoftware.Values) + foreach (var software in doc.PackageSoftware.Values) { - record.Softwares.Add((blank.Item1.SoftwareName, blank.Item2)); - record.TotalCount += blank.Item2; + record.Softwares.Add((software.Item1.SoftwareName, software.Item2)); + record.TotalCount += software.Item2; } list.Add(record); diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs index 44742c2..0e71a19 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.Designer.cs @@ -38,8 +38,13 @@ namespace SoftwareInstallationView this.buttonRef = new System.Windows.Forms.Button(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.guideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.reportsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.packageToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.storageToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + this.packagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ordersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.packageSoftwaresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -107,12 +112,13 @@ namespace SoftwareInstallationView // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.guideToolStripMenuItem}); + this.guideToolStripMenuItem, this.reportsToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(803, 24); this.menuStrip1.TabIndex = 1; - this.menuStrip1.Text = "menuStrip1"; + this.menuStrip1.Text = "Справочники"; // // guideToolStripMenuItem // @@ -125,34 +131,34 @@ namespace SoftwareInstallationView // // reportsToolStripMenuItem // - //this.reportsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - //this.packagesToolStripMenuItem, - //this.packageSoftwaresToolStripMenuItem, - //this.ordersToolStripMenuItem}); - //this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; - //this.reportsToolStripMenuItem.Size = new System.Drawing.Size(73, 24); - //this.reportsToolStripMenuItem.Text = "Отчеты"; + this.reportsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.packagesToolStripMenuItem, + this.packageSoftwaresToolStripMenuItem, + this.ordersToolStripMenuItem}); + this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; + this.reportsToolStripMenuItem.Size = new System.Drawing.Size(73, 24); + this.reportsToolStripMenuItem.Text = "Отчеты"; // // packagesToolStripMenuItem // - //this.packagesToolStripMenuItem.Name = "packagesToolStripMenuItem"; - //this.packagesToolStripMenuItem.Size = new System.Drawing.Size(252, 26); - //this.packagesToolStripMenuItem.Text = "Список пакетов"; - //this.packagesToolStripMenuItem.Click += new System.EventHandler(this.packagesToolStripMenuItem_Click); + this.packagesToolStripMenuItem.Name = "packagesToolStripMenuItem"; + this.packagesToolStripMenuItem.Size = new System.Drawing.Size(252, 26); + this.packagesToolStripMenuItem.Text = "Список пакетов"; + this.packagesToolStripMenuItem.Click += new System.EventHandler(this.packagesToolStripMenuItem_Click); // // packageSoftwaresToolStripMenuItem // - //this.packageSoftwaresToolStripMenuItem.Name = "packageSoftwaresToolStripMenuItem"; - //this.packageSoftwaresToolStripMenuItem.Size = new System.Drawing.Size(252, 26); - //this.packageSoftwaresToolStripMenuItem.Text = "ПО по пакетам"; - //this.packageSoftwaresToolStripMenuItem.Click += new System.EventHandler(this.packageSoftwaresToolStripMenuItem_Click); + this.packageSoftwaresToolStripMenuItem.Name = "packageSoftwaresToolStripMenuItem"; + this.packageSoftwaresToolStripMenuItem.Size = new System.Drawing.Size(252, 26); + this.packageSoftwaresToolStripMenuItem.Text = "ПО по пакетам"; + this.packageSoftwaresToolStripMenuItem.Click += new System.EventHandler(this.packageSoftwaresToolStripMenuItem_Click); // // ordersToolStripMenuItem // - //this.ordersToolStripMenuItem.Name = "ordersToolStripMenuItem"; - //this.ordersToolStripMenuItem.Size = new System.Drawing.Size(252, 26); - //this.ordersToolStripMenuItem.Text = "Список заказов"; - //this.ordersToolStripMenuItem.Click += new System.EventHandler(this.ordersToolStripMenuItem_Click); + this.ordersToolStripMenuItem.Name = "ordersToolStripMenuItem"; + this.ordersToolStripMenuItem.Size = new System.Drawing.Size(252, 26); + this.ordersToolStripMenuItem.Text = "Список заказов"; + this.ordersToolStripMenuItem.Click += new System.EventHandler(this.ordersToolStripMenuItem_Click); // // packageToolStripMenuItem2 // diff --git a/SoftwareInstallation/SoftwareInstallation/FormMain.cs b/SoftwareInstallation/SoftwareInstallation/FormMain.cs index 328e042..a73f022 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormMain.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormMain.cs @@ -170,7 +170,7 @@ namespace SoftwareInstallationView private void packageSoftwaresToolStripMenuItem_Click(object sender, EventArgs e) { var service = Program.ServiceProvider?.GetService(typeof(FormReportPackageSoftwares)); - if (service is FormReportOrders form) + if (service is FormReportPackageSoftwares form) { form.ShowDialog(); } diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.Designer.cs b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.Designer.cs index e6ec60f..d8d9450 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.Designer.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.Designer.cs @@ -29,10 +29,10 @@ private void InitializeComponent() { this.dataGridView = new System.Windows.Forms.DataGridView(); - this.ColumnSoftware = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnPackage = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.buttonSaveToExcel = new System.Windows.Forms.Button(); + this.ColumPackage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnSoftware = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnCount = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.SuspendLayout(); // @@ -41,8 +41,8 @@ this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight; this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.ColumPackage, this.ColumnSoftware, - this.ColumnPackage, this.ColumnCount}); this.dataGridView.Dock = System.Windows.Forms.DockStyle.Bottom; this.dataGridView.GridColor = System.Drawing.SystemColors.ButtonHighlight; @@ -52,24 +52,6 @@ this.dataGridView.Size = new System.Drawing.Size(750, 396); this.dataGridView.TabIndex = 0; // - // ColumnSoftware - // - this.ColumnSoftware.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColumnSoftware.HeaderText = "ПО"; - this.ColumnSoftware.Name = "ColumnSoftware"; - // - // ColumnPackage - // - this.ColumnPackage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColumnPackage.HeaderText = "Пакет"; - this.ColumnPackage.Name = "ColumnPackage"; - // - // ColumnCount - // - this.ColumnCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ColumnCount.HeaderText = "Количество"; - this.ColumnCount.Name = "ColumnCount"; - // // buttonSaveToExcel // this.buttonSaveToExcel.Location = new System.Drawing.Point(25, 12); @@ -80,6 +62,24 @@ this.buttonSaveToExcel.UseVisualStyleBackColor = true; this.buttonSaveToExcel.Click += new System.EventHandler(this.buttonSaveToExcel_Click); // + // ColumPackage + // + this.ColumPackage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ColumPackage.HeaderText = "Пакет"; + this.ColumPackage.Name = "ColumPackage"; + // + // ColumnSoftware + // + this.ColumnSoftware.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ColumnSoftware.HeaderText = "ПО"; + this.ColumnSoftware.Name = "ColumnSoftware"; + // + // ColumnCount + // + this.ColumnCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ColumnCount.HeaderText = "Количество"; + this.ColumnCount.Name = "ColumnCount"; + // // FormReportPackageSoftwares // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); @@ -88,7 +88,8 @@ this.Controls.Add(this.buttonSaveToExcel); this.Controls.Add(this.dataGridView); this.Name = "FormReportPackageSoftwares"; - this.Text = "FormReportPackageSoftwares"; + this.Text = "Пакеты по ПО"; + this.Load += new System.EventHandler(this.FormReportPackageSoftwares_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); @@ -97,9 +98,9 @@ #endregion private DataGridView dataGridView; - private DataGridViewTextBoxColumn ColumnSoftware; - private DataGridViewTextBoxColumn ColumnPackage; - private DataGridViewTextBoxColumn ColumnCount; private Button buttonSaveToExcel; + private DataGridViewTextBoxColumn ColumPackage; + private DataGridViewTextBoxColumn ColumnSoftware; + private DataGridViewTextBoxColumn ColumnCount; } } \ No newline at end of file diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.cs b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.cs index 7fa55b5..0eb0f8a 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.cs +++ b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.cs @@ -25,7 +25,7 @@ namespace SoftwareInstallationView _logic = logic; } - private void FormReportDocumentBlanks_Load(object sender, EventArgs e) + private void FormReportPackageSoftwares_Load(object sender, EventArgs e) { try { @@ -68,14 +68,14 @@ namespace SoftwareInstallationView { FileName = dialog.FileName }); - _logger.LogInformation("Сохранение списка документов по бланкам"); + _logger.LogInformation("Сохранение списка пакетов по ПО"); MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { - _logger.LogError(ex, "Ошибка сохранения списка документов по бланкам"); + _logger.LogError(ex, "Ошибка сохранения списка пакетов по ПО"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } diff --git a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.resx b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.resx index ab9d5fe..cde9a47 100644 --- a/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.resx +++ b/SoftwareInstallation/SoftwareInstallation/FormReportPackageSoftwares.resx @@ -57,10 +57,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + True diff --git a/SoftwareInstallation/SoftwareInstallation/Program.cs b/SoftwareInstallation/SoftwareInstallation/Program.cs index fcfffa2..f8c88a3 100644 --- a/SoftwareInstallation/SoftwareInstallation/Program.cs +++ b/SoftwareInstallation/SoftwareInstallation/Program.cs @@ -1,4 +1,4 @@ -using AbstractSoftwareInstallationDatabaseImplement.Implements; +using AbstractSoftwareInstallationFileImplement.Implements; using AbstractSoftwareInstallationBusinessLogic; using AbstractSoftwareInstallationBusinessLogic.BusinessLogic; using AbstractSoftwareInstallationContracts.BusinessLogicsContracts; @@ -55,6 +55,8 @@ namespace SoftwareInstallation services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } diff --git a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj index cf45fac..102c99c 100644 --- a/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj +++ b/SoftwareInstallation/SoftwareInstallation/SoftwareInstallationView.csproj @@ -23,6 +23,7 @@ +