From 6083e22764e75667d5a3ce1e19dd0d4ce9e25685 Mon Sep 17 00:00:00 2001 From: Timur_Sharafutdinov Date: Thu, 19 Dec 2024 12:27:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Forms/FormOrder.Designer.cs | 30 +++++++++---------- .../ProjectPublishing/Forms/FormOrder.cs | 6 ++-- .../ProjectPublishing/Forms/FormOrder.resx | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs index 43a688a..35f7719 100644 --- a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs +++ b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs @@ -30,14 +30,14 @@ { groupBoxProduct = new GroupBox(); dataGridViewProducts = new DataGridView(); - ColumnProduct = new DataGridViewComboBoxColumn(); - Column2 = new DataGridViewTextBoxColumn(); labelClient = new Label(); comboBoxClient = new ComboBox(); buttonSave = new Button(); buttonCancel = new Button(); textBoxDescription = new TextBox(); labelDescription = new Label(); + ColumnProduct = new DataGridViewComboBoxColumn(); + ColumnCount = new DataGridViewTextBoxColumn(); groupBoxProduct.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit(); SuspendLayout(); @@ -60,7 +60,7 @@ dataGridViewProducts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; dataGridViewProducts.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewProducts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewProducts.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, Column2 }); + dataGridViewProducts.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCount }); dataGridViewProducts.Location = new Point(6, 22); dataGridViewProducts.MultiSelect = false; dataGridViewProducts.Name = "dataGridViewProducts"; @@ -69,16 +69,6 @@ dataGridViewProducts.Size = new Size(265, 225); dataGridViewProducts.TabIndex = 0; // - // ColumnProduct - // - ColumnProduct.HeaderText = "Продукт"; - ColumnProduct.Name = "ColumnProduct"; - // - // Column2 - // - Column2.HeaderText = "Количество"; - Column2.Name = "Column2"; - // // labelClient // labelClient.AutoSize = true; @@ -134,6 +124,16 @@ labelDescription.TabIndex = 6; labelDescription.Text = "Описание"; // + // ColumnProduct + // + ColumnProduct.HeaderText = "Продукт"; + ColumnProduct.Name = "ColumnProduct"; + // + // ColumnCount + // + ColumnCount.HeaderText = "Количество"; + ColumnCount.Name = "ColumnCount"; + // // FormOrder // AutoScaleDimensions = new SizeF(7F, 15F); @@ -163,9 +163,9 @@ private ComboBox comboBoxClient; private DataGridView dataGridViewProducts; private Button buttonCancel; - private DataGridViewComboBoxColumn ColumnProduct; - private DataGridViewTextBoxColumn Column2; private TextBox textBoxDescription; private Label labelDescription; + private DataGridViewComboBoxColumn ColumnProduct; + private DataGridViewTextBoxColumn ColumnCount; } } \ No newline at end of file diff --git a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs index e92eb96..ecf3f22 100644 --- a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs +++ b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs @@ -40,7 +40,7 @@ namespace ProjectPublishing.Forms throw new Exception("Имеются незаполненные поля"); } _orderRepository.CreateOrder(Order.CreateOperation(0,(int)comboBoxClient.SelectedValue!, - CreateListFeedFeedReplenishmentsFromDataGrid(), textBoxDescription.Text)); + CreateListOrderProdutsFromDataGrid(), textBoxDescription.Text)); Close(); } catch (Exception ex) @@ -51,12 +51,12 @@ namespace ProjectPublishing.Forms } private void ButtonCancel_Click(object sender, EventArgs e) => Close(); private List - CreateListFeedFeedReplenishmentsFromDataGrid() + CreateListOrderProdutsFromDataGrid() { var list = new List(); foreach (DataGridViewRow row in dataGridViewProducts.Rows) { - if (row.Cells["ColumnFeed"].Value == null || + if (row.Cells["ColumnProduct"].Value == null || row.Cells["ColumnCount"].Value == null) { continue; diff --git a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx index 1fe7d22..260600d 100644 --- a/ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx +++ b/ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx @@ -120,7 +120,7 @@ True - + True \ No newline at end of file