From 9fd6e03690657dd2be953401ada3c6dff8ff941f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 20:17:16 +0400 Subject: [PATCH 1/5] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B2=D1=8B=D0=B7=D1=8B=D0=B2=D0=B0=D1=8E=D1=89=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=20=D0=B2=20FormViewPast?= =?UTF-8?q?ry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Confectionery/FormViewPastry.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Confectionery/FormViewPastry.cs b/Confectionery/FormViewPastry.cs index 33e551c..6d82947 100644 --- a/Confectionery/FormViewPastry.cs +++ b/Confectionery/FormViewPastry.cs @@ -63,12 +63,10 @@ namespace ConfectioneryView { if (dataGridView.SelectedRows.Count == 1) { - var service = - Program.ServiceProvider?.GetService(typeof(FormComponent)); - if (service is FormComponent form) + var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent)); + if (service is FormPastryComponent form) { - form.Id = - Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); if (form.ShowDialog() == DialogResult.OK) { From 50364962ece61a06e13111c47d99792c53ed0e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 20:48:18 +0400 Subject: [PATCH 2/5] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20FormComponents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Confectionery/FormComponents.cs | 9 +++------ Confectionery/FormPastry.cs | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Confectionery/FormComponents.cs b/Confectionery/FormComponents.cs index c93c9ed..351a495 100644 --- a/Confectionery/FormComponents.cs +++ b/Confectionery/FormComponents.cs @@ -64,18 +64,15 @@ namespace ConfectioneryView { if (dataGridView.SelectedRows.Count == 1) { - var service = - Program.ServiceProvider?.GetService(typeof(FormComponent)); + var service = Program.ServiceProvider?.GetService(typeof(FormComponent)); if (service is FormComponent form) { - form.Id = - Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); if (form.ShowDialog() == DialogResult.OK) { - + LoadData(); } } - LoadData(); } } private void ButtonDel_Click(object sender, EventArgs e) diff --git a/Confectionery/FormPastry.cs b/Confectionery/FormPastry.cs index f6fa367..7b09962 100644 --- a/Confectionery/FormPastry.cs +++ b/Confectionery/FormPastry.cs @@ -102,8 +102,7 @@ namespace ConfectioneryView { if (dataGridView.SelectedRows.Count == 1) { - var service = - Program.ServiceProvider?.GetService(typeof(FormPastryComponent)); + var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent)); if (service is FormPastryComponent form) { int id = @@ -118,8 +117,7 @@ namespace ConfectioneryView } _logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ", form.ComponentModel.ComponentName, form.Count); - _pastryComponents[form.Id] = (form.ComponentModel, - form.Count); + _pastryComponents[form.Id] = (form.ComponentModel, form.Count); LoadData(); } } From c03c0457b05cf334ba2ddec04bc56a0fdb7ecb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 20:59:43 +0400 Subject: [PATCH 3/5] fix --- ConfectionaryListImplement/ComponentStorage.cs | 6 ++---- Confectionery/FormPastry.cs | 3 +-- Confectionery/Program.cs | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ConfectionaryListImplement/ComponentStorage.cs b/ConfectionaryListImplement/ComponentStorage.cs index bc77ac7..fe845ab 100644 --- a/ConfectionaryListImplement/ComponentStorage.cs +++ b/ConfectionaryListImplement/ComponentStorage.cs @@ -2,10 +2,9 @@ using ConfectioneryContracts.SearchModels; using ConfectioneryContracts.StoragesContract; using ConfectioneryContracts.ViewModels; -using ConfectioneryListImplement; using ConfectioneryListImplement.Models; -namespace AbstractShopListImplement.Implements +namespace ConfectioneryListImplement.Implements { public class ComponentStorage : IComponentStorage { @@ -23,8 +22,7 @@ namespace AbstractShopListImplement.Implements } return result; } - public List GetFilteredList(ComponentSearchModel - model) + public List GetFilteredList(ComponentSearchModel model) { var result = new List(); if (string.IsNullOrEmpty(model.ComponentName)) diff --git a/Confectionery/FormPastry.cs b/Confectionery/FormPastry.cs index 7b09962..1c2c2ce 100644 --- a/Confectionery/FormPastry.cs +++ b/Confectionery/FormPastry.cs @@ -105,8 +105,7 @@ namespace ConfectioneryView var service = Program.ServiceProvider?.GetService(typeof(FormPastryComponent)); if (service is FormPastryComponent form) { - int id = - Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value); + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value); form.Id = id; form.Count = _pastryComponents[id].Item2; if (form.ShowDialog() == DialogResult.OK) diff --git a/Confectionery/Program.cs b/Confectionery/Program.cs index d3d5709..77b8767 100644 --- a/Confectionery/Program.cs +++ b/Confectionery/Program.cs @@ -1,4 +1,4 @@ -using AbstractShopListImplement.Implements; +using ConfectioneryListImplement.Implements; using ConfectioneryBusinessLogic.BusinessLogics; using ConfectioneryContracts.BusinessLogicsContracts; using ConfectioneryContracts.StoragesContract; From a50cce3f83cdce61c991d52b294ba11b2baeb59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 21:13:31 +0400 Subject: [PATCH 4/5] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9=20=D0=B8=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Confectionery/FormComponents.cs | 9 --------- Confectionery/FormPastry.cs | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Confectionery/FormComponents.cs b/Confectionery/FormComponents.cs index 351a495..2f20d12 100644 --- a/Confectionery/FormComponents.cs +++ b/Confectionery/FormComponents.cs @@ -1,15 +1,6 @@ using ConfectioneryContracts.BindingModels; using ConfectioneryContracts.BusinessLogicsContracts; using Microsoft.Extensions.Logging; -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 ConfectioneryView { diff --git a/Confectionery/FormPastry.cs b/Confectionery/FormPastry.cs index 1c2c2ce..e3e7bfd 100644 --- a/Confectionery/FormPastry.cs +++ b/Confectionery/FormPastry.cs @@ -116,7 +116,7 @@ namespace ConfectioneryView } _logger.LogInformation("Изменение компонента: { ComponentName} - { Count} ", form.ComponentModel.ComponentName, form.Count); - _pastryComponents[form.Id] = (form.ComponentModel, form.Count); + _pastryComponents[id] = (form.ComponentModel, form.Count); LoadData(); } } From 241e701722ade7f7f503d1461a80534b73cb4b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 21:17:00 +0400 Subject: [PATCH 5/5] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D0=BF=D0=BE=D0=B4=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B8=20=D1=84=D0=BE=D1=80=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Confectionery/FormComponent.Designer.cs | 2 +- Confectionery/FormComponents.Designer.cs | 2 +- Confectionery/FormViewPastry.Designer.cs | 6 +-- Confectionery/FormViewPastry.resx | 62 +----------------------- 4 files changed, 6 insertions(+), 66 deletions(-) diff --git a/Confectionery/FormComponent.Designer.cs b/Confectionery/FormComponent.Designer.cs index aeea9f9..5d51eab 100644 --- a/Confectionery/FormComponent.Designer.cs +++ b/Confectionery/FormComponent.Designer.cs @@ -100,7 +100,7 @@ this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Name = "FormComponent"; - this.Text = "FormComponent"; + this.Text = "Создание компонента"; this.ResumeLayout(false); this.PerformLayout(); diff --git a/Confectionery/FormComponents.Designer.cs b/Confectionery/FormComponents.Designer.cs index 99f6a58..dd31844 100644 --- a/Confectionery/FormComponents.Designer.cs +++ b/Confectionery/FormComponents.Designer.cs @@ -103,7 +103,7 @@ this.Controls.Add(this.buttonAdd); this.Controls.Add(this.dataGridView); this.Name = "FormComponents"; - this.Text = "FormComponents"; + this.Text = "Редактирование компонентов"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/Confectionery/FormViewPastry.Designer.cs b/Confectionery/FormViewPastry.Designer.cs index f8eb11f..3417617 100644 --- a/Confectionery/FormViewPastry.Designer.cs +++ b/Confectionery/FormViewPastry.Designer.cs @@ -82,8 +82,8 @@ // // dataGridView // - this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView.Location = new System.Drawing.Point(12, 12); @@ -103,7 +103,7 @@ this.Controls.Add(this.buttonAdd); this.Controls.Add(this.dataGridView); this.Name = "FormViewPastry"; - this.Text = "FormViewPastry"; + this.Text = "Редактирование изделий"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/Confectionery/FormViewPastry.resx b/Confectionery/FormViewPastry.resx index 1af7de1..f298a7b 100644 --- a/Confectionery/FormViewPastry.resx +++ b/Confectionery/FormViewPastry.resx @@ -1,64 +1,4 @@ - - - +