From 31655eb3246b8ea5e78668e15575f6e405944197 Mon Sep 17 00:00:00 2001 From: bekodeg Date: Thu, 22 Feb 2024 10:56:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B0=D0=B3=D0=B0=20=D1=81=20?= =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=B5=D1=80=D0=BE=D0=BC,=20=D1=83=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BD=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B0=D1=8E=D1=89=D0=B8=D1=85=20=D1=81=D0=B8?= =?UTF-8?q?=D0=B3=D0=BD=D0=B0=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SushiBar/Forms/FormComponent.Designer.cs | 1 + SushiBar/SushiBar/Forms/FormComponent.resx | 270 +++++++++--------- SushiBar/SushiBar/Forms/FormComponent.ru.resx | 12 - .../SushiBar/Forms/FormComponents.Designer.cs | 1 + .../Forms/FormCreateOrder.Designer.cs | 1 + .../SushiBar/Forms/FormCreateOrderLogic.cs | 6 - SushiBar/SushiBar/Forms/FormMain.Designer.cs | 5 +- SushiBar/SushiBar/Forms/FormSushi.Designer.cs | 16 +- SushiBar/SushiBar/Forms/FormSushi.resx | 3 + .../SushiBar/Forms/FormSushiComponentLogic.cs | 5 - SushiBar/SushiBar/Forms/FormSushiLogic.cs | 4 +- .../SushiBar/Forms/FormSushis.Designer.cs | 16 +- SushiBar/SushiBar/Program.cs | 1 + .../BusinessLogics/OrderLogic.cs | 2 +- .../BusinessLogics/SushiLogic.cs | 2 +- 15 files changed, 173 insertions(+), 172 deletions(-) diff --git a/SushiBar/SushiBar/Forms/FormComponent.Designer.cs b/SushiBar/SushiBar/Forms/FormComponent.Designer.cs index dcc8389..d1047dd 100644 --- a/SushiBar/SushiBar/Forms/FormComponent.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormComponent.Designer.cs @@ -82,6 +82,7 @@ Controls.Add(textBoxName); Controls.Add(label1); Name = "FormComponent"; + Load += this.FormComponent_Load; ResumeLayout(false); PerformLayout(); } diff --git a/SushiBar/SushiBar/Forms/FormComponent.resx b/SushiBar/SushiBar/Forms/FormComponent.resx index ac033b7..e8bc8e2 100644 --- a/SushiBar/SushiBar/Forms/FormComponent.resx +++ b/SushiBar/SushiBar/Forms/FormComponent.resx @@ -117,163 +117,58 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - FormComponent - - - $this - - - $this - - - 4 - - - buttonCancel - - - 800, 450 + + 68, 6 - - - 3 - - - $this - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - textBoxCost - - - $this - - - $this - - - 8, 20 - - - 4 - - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - button1 - - - System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - textBox1 - - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 95, 85 - - - 1 - - + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12, 42 + + 0 - - 3 + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + + 1 - + $this 0 - - System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 68, 6 - - - 0 - - - 222, 85 - - - label1 - - - 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5 - - - 1 - buttonSave - - 222, 85 - - - FormComponent - 12, 9 - - 95, 85 + + 4 - - label2 + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + $this - - 5 + + FormComponent - + 1 - - System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 800, 450 - + 2 - - 5 - - - textBoxName + + button2 $this @@ -281,8 +176,14 @@ System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 95, 85 + + + $this + + + 3 95, 39 @@ -290,11 +191,110 @@ 95, 6 - + + $this + + + 95, 85 + + + FormComponent + + + 0 + + + 222, 85 + + + System.Windows.Forms.Form, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + $this + + + 5 + + + 1 + + + $this + + + label1 + + + 1 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label2 + + + 8, 20 + + + textBox1 + + 2 - - button2 + + 5 + + + $this + + + button1 + + + buttonCancel + + + textBoxName + + + System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 222, 85 + + + textBoxCost + + + 3 + + + 4 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 4 + + + System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 12, 42 ru diff --git a/SushiBar/SushiBar/Forms/FormComponent.ru.resx b/SushiBar/SushiBar/Forms/FormComponent.ru.resx index 81e7eef..14672e4 100644 --- a/SushiBar/SushiBar/Forms/FormComponent.ru.resx +++ b/SushiBar/SushiBar/Forms/FormComponent.ru.resx @@ -147,30 +147,18 @@ Цена - - 95, 85 - 121, 29 - - 4 - Сохранить NoControl - - 222, 85 - 119, 29 - - 5 - Отмена diff --git a/SushiBar/SushiBar/Forms/FormComponents.Designer.cs b/SushiBar/SushiBar/Forms/FormComponents.Designer.cs index 4fc6149..b8388ed 100644 --- a/SushiBar/SushiBar/Forms/FormComponents.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormComponents.Designer.cs @@ -99,6 +99,7 @@ Controls.Add(dataGridView); Name = "FormComponents"; Text = "Компоненты"; + Load += this.FormComponents_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); } diff --git a/SushiBar/SushiBar/Forms/FormCreateOrder.Designer.cs b/SushiBar/SushiBar/Forms/FormCreateOrder.Designer.cs index becf85e..858efb1 100644 --- a/SushiBar/SushiBar/Forms/FormCreateOrder.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormCreateOrder.Designer.cs @@ -123,6 +123,7 @@ Controls.Add(buttonSave); Name = "FormCreateOrder"; Text = "Заказ"; + Load += this.FormCreateOrder_Load; ResumeLayout(false); PerformLayout(); } diff --git a/SushiBar/SushiBar/Forms/FormCreateOrderLogic.cs b/SushiBar/SushiBar/Forms/FormCreateOrderLogic.cs index e9c9c0b..d93c6a4 100644 --- a/SushiBar/SushiBar/Forms/FormCreateOrderLogic.cs +++ b/SushiBar/SushiBar/Forms/FormCreateOrderLogic.cs @@ -2,12 +2,6 @@ using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; using SushiBarContracts.SearchModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; namespace SushiBar.Forms { diff --git a/SushiBar/SushiBar/Forms/FormMain.Designer.cs b/SushiBar/SushiBar/Forms/FormMain.Designer.cs index 2a6b24a..6006e8e 100644 --- a/SushiBar/SushiBar/Forms/FormMain.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormMain.Designer.cs @@ -72,14 +72,14 @@ // sushiToolStripMenuItem // sushiToolStripMenuItem.Name = "sushiToolStripMenuItem"; - sushiToolStripMenuItem.Size = new Size(224, 26); + sushiToolStripMenuItem.Size = new Size(182, 26); sushiToolStripMenuItem.Text = "Суши"; sushiToolStripMenuItem.Click += sushiToolStripMenuItem_Click; // // componentsToolStripMenuItem // componentsToolStripMenuItem.Name = "componentsToolStripMenuItem"; - componentsToolStripMenuItem.Size = new Size(224, 26); + componentsToolStripMenuItem.Size = new Size(182, 26); componentsToolStripMenuItem.Text = "Компоненты"; componentsToolStripMenuItem.Click += componentsToolStripMenuItem_Click; // @@ -148,6 +148,7 @@ MainMenuStrip = menuStrip1; Name = "FormMain"; Text = "Сушибар"; + Load += this.FormMain_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); menuStrip1.ResumeLayout(false); menuStrip1.PerformLayout(); diff --git a/SushiBar/SushiBar/Forms/FormSushi.Designer.cs b/SushiBar/SushiBar/Forms/FormSushi.Designer.cs index 3d2a278..088ba1e 100644 --- a/SushiBar/SushiBar/Forms/FormSushi.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormSushi.Designer.cs @@ -30,6 +30,7 @@ { buttonAdd = new Button(); dataGridView = new DataGridView(); + ID = new DataGridViewTextBoxColumn(); ComponentName = new DataGridViewTextBoxColumn(); ComponentCount = new DataGridViewTextBoxColumn(); groupBox1 = new GroupBox(); @@ -62,7 +63,7 @@ dataGridView.AllowUserToAddRows = false; dataGridView.AllowUserToDeleteRows = false; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Columns.AddRange(new DataGridViewColumn[] { ComponentName, ComponentCount }); + dataGridView.Columns.AddRange(new DataGridViewColumn[] { ID, ComponentName, ComponentCount }); dataGridView.Dock = DockStyle.Left; dataGridView.Location = new Point(3, 24); dataGridView.Margin = new Padding(3, 4, 3, 4); @@ -73,18 +74,29 @@ dataGridView.Size = new Size(630, 267); dataGridView.TabIndex = 1; // + // ID + // + ID.HeaderText = ""; + ID.MinimumWidth = 6; + ID.Name = "ID"; + ID.ReadOnly = true; + ID.Visible = false; + ID.Width = 125; + // // ComponentName // ComponentName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; ComponentName.HeaderText = "Компонент"; ComponentName.MinimumWidth = 6; ComponentName.Name = "ComponentName"; + ComponentName.ReadOnly = true; // // ComponentCount // ComponentCount.HeaderText = "Количество"; ComponentCount.MinimumWidth = 6; ComponentCount.Name = "ComponentCount"; + ComponentCount.ReadOnly = true; ComponentCount.Width = 125; // // groupBox1 @@ -208,6 +220,7 @@ Controls.Add(groupBox1); Name = "FormSushi"; Text = "Суши"; + Load += this.FormSushi_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); groupBox1.ResumeLayout(false); ResumeLayout(false); @@ -228,6 +241,7 @@ private Label label2; private TextBox textBoxPrice; private TextBox textBoxName; + private DataGridViewTextBoxColumn ID; private DataGridViewTextBoxColumn ComponentName; private DataGridViewTextBoxColumn ComponentCount; } diff --git a/SushiBar/SushiBar/Forms/FormSushi.resx b/SushiBar/SushiBar/Forms/FormSushi.resx index 29c43a9..b17d555 100644 --- a/SushiBar/SushiBar/Forms/FormSushi.resx +++ b/SushiBar/SushiBar/Forms/FormSushi.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + True diff --git a/SushiBar/SushiBar/Forms/FormSushiComponentLogic.cs b/SushiBar/SushiBar/Forms/FormSushiComponentLogic.cs index a776a59..bcbd12e 100644 --- a/SushiBar/SushiBar/Forms/FormSushiComponentLogic.cs +++ b/SushiBar/SushiBar/Forms/FormSushiComponentLogic.cs @@ -1,11 +1,6 @@ using SushiBarContracts.BusinessLogicsContracts; using SushiBarContracts.ViewModels; using SushiBarDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace SushiBar.Forms { diff --git a/SushiBar/SushiBar/Forms/FormSushiLogic.cs b/SushiBar/SushiBar/Forms/FormSushiLogic.cs index a87d886..9df5936 100644 --- a/SushiBar/SushiBar/Forms/FormSushiLogic.cs +++ b/SushiBar/SushiBar/Forms/FormSushiLogic.cs @@ -54,9 +54,9 @@ namespace SushiBar.Forms if (_sushiComponents != null) { dataGridView.Rows.Clear(); - foreach (var pc in _sushiComponents) + foreach (var sc in _sushiComponents) { - dataGridView.Rows.Add(new object[] { pc.Key, pc.Value.Item1.ComponentName, pc.Value.Item2 }); + dataGridView.Rows.Add(new object[] { sc.Key, sc.Value.Item1.ComponentName, sc.Value.Item2 }); } textBoxPrice.Text = CalcPrice().ToString(); } diff --git a/SushiBar/SushiBar/Forms/FormSushis.Designer.cs b/SushiBar/SushiBar/Forms/FormSushis.Designer.cs index cb77827..ba06d1d 100644 --- a/SushiBar/SushiBar/Forms/FormSushis.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormSushis.Designer.cs @@ -38,18 +38,19 @@ // // dataGridView // + dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView.Dock = DockStyle.Left; dataGridView.Location = new Point(0, 0); dataGridView.Name = "dataGridView"; - dataGridView.RowHeadersWidth = 51; + dataGridView.RowHeadersWidth = 70; dataGridView.RowTemplate.Height = 29; - dataGridView.Size = new Size(668, 450); + dataGridView.Size = new Size(762, 450); dataGridView.TabIndex = 1; // // buttonRef // - buttonRef.Location = new Point(674, 117); + buttonRef.Location = new Point(768, 117); buttonRef.Name = "buttonRef"; buttonRef.Size = new Size(114, 29); buttonRef.TabIndex = 8; @@ -59,7 +60,7 @@ // // buttonDel // - buttonDel.Location = new Point(674, 82); + buttonDel.Location = new Point(768, 82); buttonDel.Name = "buttonDel"; buttonDel.Size = new Size(114, 29); buttonDel.TabIndex = 7; @@ -69,7 +70,7 @@ // // buttonUpd // - buttonUpd.Location = new Point(674, 47); + buttonUpd.Location = new Point(768, 47); buttonUpd.Name = "buttonUpd"; buttonUpd.Size = new Size(114, 29); buttonUpd.TabIndex = 6; @@ -79,7 +80,7 @@ // // buttonAdd // - buttonAdd.Location = new Point(674, 12); + buttonAdd.Location = new Point(768, 12); buttonAdd.Name = "buttonAdd"; buttonAdd.Size = new Size(114, 29); buttonAdd.TabIndex = 5; @@ -91,7 +92,7 @@ // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(893, 450); Controls.Add(buttonRef); Controls.Add(buttonDel); Controls.Add(buttonUpd); @@ -99,6 +100,7 @@ Controls.Add(dataGridView); Name = "FormSushis"; Text = "Суши"; + Load += this.FormSushis_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); } diff --git a/SushiBar/SushiBar/Program.cs b/SushiBar/SushiBar/Program.cs index 0627eda..430a8f7 100644 --- a/SushiBar/SushiBar/Program.cs +++ b/SushiBar/SushiBar/Program.cs @@ -25,6 +25,7 @@ namespace SushiBar var services = new ServiceCollection(); ConfigureServices(services); _serviceProvider = services.BuildServiceProvider(); + ILogger logger = _serviceProvider.GetService(); Application.Run(_serviceProvider.GetRequiredService()); } private static void ConfigureServices(ServiceCollection services) diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs index 22b6922..7b16179 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs @@ -12,7 +12,7 @@ namespace SushiBarBusinessLogic.BusinessLogics { private readonly ILogger _logger; private readonly IOrderStorage _orderStorage; - public OrderLogic(ILogger logger, IOrderStorage orderStorage) + public OrderLogic(ILogger logger, IOrderStorage orderStorage) { _logger = logger; _orderStorage = orderStorage; diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/SushiLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/SushiLogic.cs index 2cf5260..0a1fa92 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/SushiLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/SushiLogic.cs @@ -11,7 +11,7 @@ namespace SushiBarBusinessLogic.BusinessLogics { private readonly ILogger _logger; private readonly ISushiStorage _sushiStorage; - public SushiLogic(ILogger logger, ISushiStorage sushiStorage) + public SushiLogic(ILogger logger, ISushiStorage sushiStorage) { _logger = logger; _sushiStorage = sushiStorage;