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/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/FormComponents.cs b/Confectionery/FormComponents.cs index b9600b5..3368e14 100644 --- a/Confectionery/FormComponents.cs +++ b/Confectionery/FormComponents.cs @@ -55,18 +55,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/FormCreateOrder.Designer.cs b/Confectionery/FormCreateOrder.Designer.cs index ba8add5..b03bf76 100644 --- a/Confectionery/FormCreateOrder.Designer.cs +++ b/Confectionery/FormCreateOrder.Designer.cs @@ -127,7 +127,7 @@ this.Controls.Add(this.label1); this.Name = "FormCreateOrder"; this.Text = "Создание заказа"; - this.Load += new System.EventHandler(this.FormCreateOrder_Load_1); + this.Load += new System.EventHandler(this.FormCreateOrder_Load); ((System.ComponentModel.ISupportInitialize)(this.textBoxCount)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Confectionery/FormCreateOrder.cs b/Confectionery/FormCreateOrder.cs index 0655785..47cd686 100644 --- a/Confectionery/FormCreateOrder.cs +++ b/Confectionery/FormCreateOrder.cs @@ -114,12 +114,6 @@ namespace ConfectioneryView DialogResult = DialogResult.Cancel; Close(); } - - private void FormCreateOrder_Load_1(object sender, EventArgs e) - { - - - } } } diff --git a/Confectionery/FormPastry.cs b/Confectionery/FormPastry.cs index f6fa367..e3e7bfd 100644 --- a/Confectionery/FormPastry.cs +++ b/Confectionery/FormPastry.cs @@ -102,12 +102,10 @@ 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 = - 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) @@ -118,8 +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(); } } 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.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) { 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 @@ - - - + diff --git a/Confectionery/Program.cs b/Confectionery/Program.cs index 645885a..aaddbfb 100644 --- a/Confectionery/Program.cs +++ b/Confectionery/Program.cs @@ -1,4 +1,4 @@ -using AbstractShopListImplement.Implements; +using ConfectioneryListImplement.Implements; using ConfectioneryBusinessLogic; using ConfectioneryBusinessLogic.BusinessLogics; using ConfectioneryContracts.BusinessLogicsContracts;