diff --git a/Pizzeria/PizzeriaView/Form1.Designer.cs b/Pizzeria/PizzeriaView/Form1.Designer.cs deleted file mode 100644 index 6a6f0d1..0000000 --- a/Pizzeria/PizzeriaView/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace PizzeriaView -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} diff --git a/Pizzeria/PizzeriaView/Form1.cs b/Pizzeria/PizzeriaView/Form1.cs deleted file mode 100644 index f9ed918..0000000 --- a/Pizzeria/PizzeriaView/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace PizzeriaView -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} diff --git a/Pizzeria/PizzeriaView/Form1.resx b/Pizzeria/PizzeriaView/Form1.resx deleted file mode 100644 index 1af7de1..0000000 --- a/Pizzeria/PizzeriaView/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Pizzeria/PizzeriaView/FormComponent.Designer.cs b/Pizzeria/PizzeriaView/FormComponent.Designer.cs index 90d35e8..e5f374e 100644 --- a/Pizzeria/PizzeriaView/FormComponent.Designer.cs +++ b/Pizzeria/PizzeriaView/FormComponent.Designer.cs @@ -47,7 +47,7 @@ // textBoxCost.Location = new Point(124, 92); textBoxCost.Name = "textBoxCost"; - textBoxCost.Size = new Size(132, 31); + textBoxCost.Size = new Size(182, 31); textBoxCost.TabIndex = 1; // // labelName @@ -82,7 +82,7 @@ // buttonCancel.Location = new Point(257, 155); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(100, 47); + buttonCancel.Size = new Size(106, 47); buttonCancel.TabIndex = 5; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; @@ -92,7 +92,7 @@ // AutoScaleDimensions = new SizeF(10F, 25F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(469, 214); + ClientSize = new Size(465, 214); Controls.Add(buttonCancel); Controls.Add(buttonSave); Controls.Add(labelCost); diff --git a/Pizzeria/PizzeriaView/FormCreateOrder.Designer.cs b/Pizzeria/PizzeriaView/FormCreateOrder.Designer.cs index edc1d24..daea447 100644 --- a/Pizzeria/PizzeriaView/FormCreateOrder.Designer.cs +++ b/Pizzeria/PizzeriaView/FormCreateOrder.Designer.cs @@ -40,6 +40,7 @@ // // comboBoxPizza // + comboBoxPizza.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxPizza.FormattingEnabled = true; comboBoxPizza.Location = new Point(166, 25); comboBoxPizza.Name = "comboBoxPizza"; @@ -50,7 +51,7 @@ // textBoxCount.Location = new Point(166, 71); textBoxCount.Name = "textBoxCount"; - textBoxCount.Size = new Size(199, 31); + textBoxCount.Size = new Size(274, 31); textBoxCount.TabIndex = 1; textBoxCount.TextChanged += textBoxCount_TextChanged; // @@ -58,15 +59,16 @@ // textBoxSum.Location = new Point(166, 120); textBoxSum.Name = "textBoxSum"; - textBoxSum.Size = new Size(239, 31); + textBoxSum.ReadOnly = true; + textBoxSum.Size = new Size(274, 31); textBoxSum.TabIndex = 2; textBoxSum.TextChanged += textBoxSum_TextChanged; // // buttonSave // - buttonSave.Location = new Point(192, 208); + buttonSave.Location = new Point(166, 208); buttonSave.Name = "buttonSave"; - buttonSave.Size = new Size(88, 46); + buttonSave.Size = new Size(114, 46); buttonSave.TabIndex = 3; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; @@ -74,9 +76,9 @@ // // buttonCancel // - buttonCancel.Location = new Point(313, 211); + buttonCancel.Location = new Point(313, 208); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(153, 40); + buttonCancel.Size = new Size(153, 46); buttonCancel.TabIndex = 4; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; @@ -123,7 +125,7 @@ Controls.Add(textBoxCount); Controls.Add(comboBoxPizza); Name = "FormCreateOrder"; - Text = "FormCreateOrder"; + Text = "Заказ"; Load += FormCreateOrder_Load; ResumeLayout(false); PerformLayout(); diff --git a/Pizzeria/PizzeriaView/FormMain.Designer.cs b/Pizzeria/PizzeriaView/FormMain.Designer.cs index 5bbfd06..c3b5ae8 100644 --- a/Pizzeria/PizzeriaView/FormMain.Designer.cs +++ b/Pizzeria/PizzeriaView/FormMain.Designer.cs @@ -44,61 +44,62 @@ // // dataGridView // + dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView.Location = new Point(0, 28); dataGridView.Name = "dataGridView"; dataGridView.RowHeadersWidth = 62; dataGridView.RowTemplate.Height = 33; - dataGridView.Size = new Size(548, 410); + dataGridView.Size = new Size(1389, 492); dataGridView.TabIndex = 1; // // buttonCreateOrder // - buttonCreateOrder.Location = new Point(607, 49); + buttonCreateOrder.Location = new Point(1413, 58); buttonCreateOrder.Name = "buttonCreateOrder"; - buttonCreateOrder.Size = new Size(166, 33); + buttonCreateOrder.Size = new Size(207, 33); buttonCreateOrder.TabIndex = 2; - buttonCreateOrder.Text = "button1"; + buttonCreateOrder.Text = "Создать заказ"; buttonCreateOrder.UseVisualStyleBackColor = true; buttonCreateOrder.Click += buttonCreateOrder_Click; // // buttonTakeOrderInWork // - buttonTakeOrderInWork.Location = new Point(607, 112); + buttonTakeOrderInWork.Location = new Point(1413, 115); buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - buttonTakeOrderInWork.Size = new Size(166, 33); + buttonTakeOrderInWork.Size = new Size(207, 33); buttonTakeOrderInWork.TabIndex = 3; - buttonTakeOrderInWork.Text = "button2"; + buttonTakeOrderInWork.Text = "Отдать на выполнение"; buttonTakeOrderInWork.UseVisualStyleBackColor = true; buttonTakeOrderInWork.Click += buttonTakeOrderInWork_Click; // // buttonOrderReady // - buttonOrderReady.Location = new Point(607, 174); + buttonOrderReady.Location = new Point(1413, 179); buttonOrderReady.Name = "buttonOrderReady"; - buttonOrderReady.Size = new Size(166, 33); + buttonOrderReady.Size = new Size(207, 33); buttonOrderReady.TabIndex = 4; - buttonOrderReady.Text = "button3"; + buttonOrderReady.Text = "Заказ готов"; buttonOrderReady.UseVisualStyleBackColor = true; buttonOrderReady.Click += buttonOrderReady_Click; // // buttonIssuedOrder // - buttonIssuedOrder.Location = new Point(607, 249); + buttonIssuedOrder.Location = new Point(1413, 251); buttonIssuedOrder.Name = "buttonIssuedOrder"; - buttonIssuedOrder.Size = new Size(166, 33); + buttonIssuedOrder.Size = new Size(207, 33); buttonIssuedOrder.TabIndex = 5; - buttonIssuedOrder.Text = "button4"; + buttonIssuedOrder.Text = "Заказ выдан"; buttonIssuedOrder.UseVisualStyleBackColor = true; buttonIssuedOrder.Click += buttonIssuedOrder_Click; // // buttonRef // - buttonRef.Location = new Point(607, 324); + buttonRef.Location = new Point(1413, 313); buttonRef.Name = "buttonRef"; - buttonRef.Size = new Size(166, 33); + buttonRef.Size = new Size(207, 33); buttonRef.TabIndex = 6; - buttonRef.Text = "button5"; + buttonRef.Text = "Обновить список"; buttonRef.UseVisualStyleBackColor = true; buttonRef.Click += buttonRef_Click; // @@ -108,7 +109,7 @@ bookToolStripMenuItem.Items.AddRange(new ToolStripItem[] { справочникToolStripMenuItem }); bookToolStripMenuItem.Location = new Point(0, 0); bookToolStripMenuItem.Name = "bookToolStripMenuItem"; - bookToolStripMenuItem.Size = new Size(800, 33); + bookToolStripMenuItem.Size = new Size(1641, 33); bookToolStripMenuItem.TabIndex = 7; bookToolStripMenuItem.Text = "menuStrip1"; // @@ -137,7 +138,7 @@ // AutoScaleDimensions = new SizeF(10F, 25F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(1641, 532); Controls.Add(buttonRef); Controls.Add(buttonIssuedOrder); Controls.Add(buttonOrderReady); @@ -147,7 +148,7 @@ Controls.Add(bookToolStripMenuItem); MainMenuStrip = bookToolStripMenuItem; Name = "FormMain"; - Text = "Form1"; + Text = "Пиццерия"; Load += FormMain_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); bookToolStripMenuItem.ResumeLayout(false); diff --git a/Pizzeria/PizzeriaView/FormMain.cs b/Pizzeria/PizzeriaView/FormMain.cs index 82a23c3..c045af5 100644 --- a/Pizzeria/PizzeriaView/FormMain.cs +++ b/Pizzeria/PizzeriaView/FormMain.cs @@ -1,8 +1,6 @@ using Microsoft.Extensions.Logging; -using PizzeriaView; using PizzeriaContracts.BindingModels; using PizzeriaContracts.BusinessLogicsContracts; -using System.Windows.Forms; namespace PizzeriaView { @@ -18,16 +16,6 @@ namespace PizzeriaView _orderLogic = orderLogic; } - private void buttonCreateOrder_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); - if (service is FormCreateOrder form) - { - form.ShowDialog(); - - } - } - private void FormMain_Load(object sender, EventArgs e) { LoadData(); @@ -72,6 +60,16 @@ namespace PizzeriaView } } + private void buttonCreateOrder_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); + if (service is FormCreateOrder form) + { + form.ShowDialog(); + LoadData(); + } + } + private void buttonTakeOrderInWork_Click(object sender, EventArgs e) { if (dataGridView.SelectedRows.Count == 1) diff --git a/Pizzeria/PizzeriaView/FormMain.resx b/Pizzeria/PizzeriaView/FormMain.resx index 3eca2d0..eb0bb20 100644 --- a/Pizzeria/PizzeriaView/FormMain.resx +++ b/Pizzeria/PizzeriaView/FormMain.resx @@ -120,4 +120,7 @@ 17, 17 + + 25 + \ No newline at end of file diff --git a/Pizzeria/PizzeriaView/FormPizza.Designer.cs b/Pizzeria/PizzeriaView/FormPizza.Designer.cs index 460b0bf..14f7b48 100644 --- a/Pizzeria/PizzeriaView/FormPizza.Designer.cs +++ b/Pizzeria/PizzeriaView/FormPizza.Designer.cs @@ -33,28 +33,28 @@ labelName = new Label(); labelCost = new Label(); dataGridView = new DataGridView(); - ColumnId = new DataGridViewTextBoxColumn(); - ColumnComponent = new DataGridViewTextBoxColumn(); - ColumnCount = new DataGridViewTextBoxColumn(); buttonAdd = new Button(); buttonEdit = new Button(); buttonDelete = new Button(); buttonUpdate = new Button(); buttonSave = new Button(); buttonCancel = new Button(); + ColumnId = new DataGridViewTextBoxColumn(); + ColumnComponent = new DataGridViewTextBoxColumn(); + ColumnCount = new DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); // // textBoxName // - textBoxName.Location = new Point(244, 23); + textBoxName.Location = new Point(116, 23); textBoxName.Name = "textBoxName"; textBoxName.Size = new Size(265, 31); textBoxName.TabIndex = 0; // // textBoxPrice // - textBoxPrice.Location = new Point(244, 70); + textBoxPrice.Location = new Point(116, 67); textBoxPrice.Name = "textBoxPrice"; textBoxPrice.Size = new Size(259, 31); textBoxPrice.TabIndex = 1; @@ -62,7 +62,7 @@ // labelName // labelName.AutoSize = true; - labelName.Location = new Point(148, 29); + labelName.Location = new Point(12, 23); labelName.Name = "labelName"; labelName.Size = new Size(90, 25); labelName.TabIndex = 2; @@ -71,7 +71,7 @@ // labelCost // labelCost.AutoSize = true; - labelCost.Location = new Point(148, 89); + labelCost.Location = new Point(12, 70); labelCost.Name = "labelCost"; labelCost.Size = new Size(53, 25); labelCost.TabIndex = 3; @@ -81,6 +81,7 @@ // dataGridView.AllowUserToAddRows = false; dataGridView.AllowUserToDeleteRows = false; + dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnId, ColumnComponent, ColumnCount }); dataGridView.Location = new Point(12, 117); @@ -91,36 +92,11 @@ dataGridView.Size = new Size(497, 335); dataGridView.TabIndex = 4; // - // ColumnId - // - ColumnId.HeaderText = "Id"; - ColumnId.MinimumWidth = 8; - ColumnId.Name = "ColumnId"; - ColumnId.ReadOnly = true; - ColumnId.Visible = false; - ColumnId.Width = 150; - // - // ColumnComponent - // - ColumnComponent.HeaderText = "Компонент"; - ColumnComponent.MinimumWidth = 6; - ColumnComponent.Name = "ColumnComponent"; - ColumnComponent.ReadOnly = true; - ColumnComponent.Width = 150; - // - // ColumnCount - // - ColumnCount.HeaderText = "Количество"; - ColumnCount.MinimumWidth = 8; - ColumnCount.Name = "ColumnCount"; - ColumnCount.ReadOnly = true; - ColumnCount.Width = 150; - // // buttonAdd // - buttonAdd.Location = new Point(601, 132); + buttonAdd.Location = new Point(587, 117); buttonAdd.Name = "buttonAdd"; - buttonAdd.Size = new Size(133, 52); + buttonAdd.Size = new Size(160, 52); buttonAdd.TabIndex = 5; buttonAdd.Text = "Добавить"; buttonAdd.UseVisualStyleBackColor = true; @@ -128,9 +104,9 @@ // // buttonEdit // - buttonEdit.Location = new Point(600, 219); + buttonEdit.Location = new Point(587, 198); buttonEdit.Name = "buttonEdit"; - buttonEdit.Size = new Size(133, 30); + buttonEdit.Size = new Size(160, 51); buttonEdit.TabIndex = 6; buttonEdit.Text = "Изменить"; buttonEdit.UseVisualStyleBackColor = true; @@ -138,9 +114,9 @@ // // buttonDelete // - buttonDelete.Location = new Point(603, 280); + buttonDelete.Location = new Point(587, 278); buttonDelete.Name = "buttonDelete"; - buttonDelete.Size = new Size(126, 36); + buttonDelete.Size = new Size(160, 51); buttonDelete.TabIndex = 7; buttonDelete.Text = "Удалить"; buttonDelete.UseVisualStyleBackColor = true; @@ -148,9 +124,9 @@ // // buttonUpdate // - buttonUpdate.Location = new Point(611, 355); + buttonUpdate.Location = new Point(587, 358); buttonUpdate.Name = "buttonUpdate"; - buttonUpdate.Size = new Size(126, 42); + buttonUpdate.Size = new Size(160, 46); buttonUpdate.TabIndex = 8; buttonUpdate.Text = "Обновить"; buttonUpdate.UseVisualStyleBackColor = true; @@ -158,9 +134,9 @@ // // buttonSave // - buttonSave.Location = new Point(524, 411); + buttonSave.Location = new Point(534, 453); buttonSave.Name = "buttonSave"; - buttonSave.Size = new Size(74, 27); + buttonSave.Size = new Size(115, 49); buttonSave.TabIndex = 9; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; @@ -168,19 +144,41 @@ // // buttonCancel // - buttonCancel.Location = new Point(648, 414); + buttonCancel.Location = new Point(655, 453); buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(105, 28); + buttonCancel.Size = new Size(105, 49); buttonCancel.TabIndex = 10; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += buttonCancel_Click; // + // ColumnId + // + ColumnId.HeaderText = "Id"; + ColumnId.MinimumWidth = 8; + ColumnId.Name = "ColumnId"; + ColumnId.ReadOnly = true; + ColumnId.Visible = false; + // + // ColumnComponent + // + ColumnComponent.HeaderText = "Ингредиент"; + ColumnComponent.MinimumWidth = 6; + ColumnComponent.Name = "ColumnComponent"; + ColumnComponent.ReadOnly = true; + // + // ColumnCount + // + ColumnCount.HeaderText = "Количество"; + ColumnCount.MinimumWidth = 8; + ColumnCount.Name = "ColumnCount"; + ColumnCount.ReadOnly = true; + // // FormPizza // AutoScaleDimensions = new SizeF(10F, 25F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(800, 533); Controls.Add(buttonCancel); Controls.Add(buttonSave); Controls.Add(buttonUpdate); @@ -193,7 +191,7 @@ Controls.Add(textBoxPrice); Controls.Add(textBoxName); Name = "FormPizza"; - Text = "FormPizza"; + Text = "Пицца"; Load += FormPizza_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); diff --git a/Pizzeria/PizzeriaView/FormPizza.resx b/Pizzeria/PizzeriaView/FormPizza.resx index 524a4e1..5c6df87 100644 --- a/Pizzeria/PizzeriaView/FormPizza.resx +++ b/Pizzeria/PizzeriaView/FormPizza.resx @@ -126,4 +126,13 @@ True + + True + + + True + + + True + \ No newline at end of file diff --git a/Pizzeria/PizzeriaView/FormPizzaComponent.Designer.cs b/Pizzeria/PizzeriaView/FormPizzaComponent.Designer.cs index 7adaade..db673fd 100644 --- a/Pizzeria/PizzeriaView/FormPizzaComponent.Designer.cs +++ b/Pizzeria/PizzeriaView/FormPizzaComponent.Designer.cs @@ -54,20 +54,20 @@ // labelComponent // labelComponent.AutoSize = true; - labelComponent.Location = new Point(38, 35); + labelComponent.Location = new Point(12, 35); labelComponent.Name = "labelComponent"; - labelComponent.Size = new Size(59, 25); + labelComponent.Size = new Size(108, 25); labelComponent.TabIndex = 2; - labelComponent.Text = "label1"; + labelComponent.Text = "Ингредиент"; // // labelCount // labelCount.AutoSize = true; - labelCount.Location = new Point(38, 91); + labelCount.Location = new Point(12, 91); labelCount.Name = "labelCount"; - labelCount.Size = new Size(59, 25); + labelCount.Size = new Size(107, 25); labelCount.TabIndex = 3; - labelCount.Text = "label2"; + labelCount.Text = "Количество"; // // buttonSave // diff --git a/Pizzeria/PizzeriaView/FormPizzas.Designer.cs b/Pizzeria/PizzeriaView/FormPizzas.Designer.cs index c8386f9..eaeb961 100644 --- a/Pizzeria/PizzeriaView/FormPizzas.Designer.cs +++ b/Pizzeria/PizzeriaView/FormPizzas.Designer.cs @@ -52,7 +52,7 @@ buttonAdd.Name = "buttonAdd"; buttonAdd.Size = new Size(202, 71); buttonAdd.TabIndex = 1; - buttonAdd.Text = "button1"; + buttonAdd.Text = "Добавить"; buttonAdd.UseVisualStyleBackColor = true; buttonAdd.Click += buttonAdd_Click; // @@ -62,17 +62,17 @@ buttonEdit.Name = "buttonEdit"; buttonEdit.Size = new Size(202, 71); buttonEdit.TabIndex = 2; - buttonEdit.Text = "button2"; + buttonEdit.Text = "Изменить"; buttonEdit.UseVisualStyleBackColor = true; buttonEdit.Click += buttonEdit_Click; // // buttonDelete // - buttonDelete.Location = new Point(540, 217); + buttonDelete.Location = new Point(540, 231); buttonDelete.Name = "buttonDelete"; buttonDelete.Size = new Size(202, 71); buttonDelete.TabIndex = 3; - buttonDelete.Text = "button3"; + buttonDelete.Text = "Удалить"; buttonDelete.UseVisualStyleBackColor = true; buttonDelete.Click += buttonDelete_Click; // @@ -82,7 +82,7 @@ buttonUpdate.Name = "buttonUpdate"; buttonUpdate.Size = new Size(202, 71); buttonUpdate.TabIndex = 4; - buttonUpdate.Text = "button4"; + buttonUpdate.Text = "Обновить"; buttonUpdate.UseVisualStyleBackColor = true; buttonUpdate.Click += buttonUpdate_Click; // @@ -97,7 +97,7 @@ Controls.Add(buttonAdd); Controls.Add(dataGridView); Name = "FormPizzas"; - Text = "FormPizzas"; + Text = "Пицца"; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); } diff --git a/Pizzeria/PizzeriaView/PizzeriaView.csproj b/Pizzeria/PizzeriaView/PizzeriaView.csproj index 9fb823c..30413a5 100644 --- a/Pizzeria/PizzeriaView/PizzeriaView.csproj +++ b/Pizzeria/PizzeriaView/PizzeriaView.csproj @@ -28,6 +28,7 @@ +