diff --git a/FoodOrders/FoodOrders/FormMain.Designer.cs b/FoodOrders/FoodOrders/FormMain.Designer.cs index 894f2eb..6a67f86 100644 --- a/FoodOrders/FoodOrders/FormMain.Designer.cs +++ b/FoodOrders/FoodOrders/FormMain.Designer.cs @@ -42,6 +42,7 @@ ButtonOrderReady = new Button(); ButtonIssuedOrder = new Button(); ButtonRef = new Button(); + ClientToolStripMenuItem = new ToolStripMenuItem(); menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -58,7 +59,7 @@ // // справочникиToolStripMenuItem // - справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { КомпонентыToolStripMenuItem, БлюдаToolStripMenuItem }); + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { КомпонентыToolStripMenuItem, БлюдаToolStripMenuItem, ClientToolStripMenuItem }); справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; справочникиToolStripMenuItem.Size = new Size(117, 24); справочникиToolStripMenuItem.Text = "Справочники"; @@ -66,14 +67,14 @@ // КомпонентыToolStripMenuItem // КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem"; - КомпонентыToolStripMenuItem.Size = new Size(182, 26); + КомпонентыToolStripMenuItem.Size = new Size(224, 26); КомпонентыToolStripMenuItem.Text = "Компоненты"; КомпонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click; // // БлюдаToolStripMenuItem // БлюдаToolStripMenuItem.Name = "БлюдаToolStripMenuItem"; - БлюдаToolStripMenuItem.Size = new Size(182, 26); + БлюдаToolStripMenuItem.Size = new Size(224, 26); БлюдаToolStripMenuItem.Text = "Блюда"; БлюдаToolStripMenuItem.Click += ИзделияToolStripMenuItem_Click; // @@ -166,6 +167,13 @@ ButtonRef.UseVisualStyleBackColor = true; ButtonRef.Click += ButtonRef_Click; // + // ClientToolStripMenuItem + // + ClientToolStripMenuItem.Name = "ClientToolStripMenuItem"; + ClientToolStripMenuItem.Size = new Size(224, 26); + ClientToolStripMenuItem.Text = "Клиенты"; + ClientToolStripMenuItem.Click += ClientToolStripMenuItem_Click; + // // FormMain // AutoScaleDimensions = new SizeF(8F, 20F); @@ -205,5 +213,6 @@ private ToolStripMenuItem ComponentToolStripMenuItem; private ToolStripMenuItem ComponentProductsToolStripMenuItem; private ToolStripMenuItem OrdersToolStripMenuItem; + private ToolStripMenuItem ClientToolStripMenuItem; } } \ No newline at end of file diff --git a/FoodOrders/FoodOrders/FormMain.cs b/FoodOrders/FoodOrders/FormMain.cs index 16a8ca7..68536e0 100644 --- a/FoodOrders/FoodOrders/FormMain.cs +++ b/FoodOrders/FoodOrders/FormMain.cs @@ -38,6 +38,7 @@ namespace FoodOrders if (list != null) { dataGridView.DataSource = list; + dataGridView.Columns["ClientId"].Visible = false; dataGridView.Columns["DishId"].Visible = false; } _logger.LogInformation("Загрузка заказов"); @@ -193,5 +194,14 @@ namespace FoodOrders } } + + private void ClientToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormClients)); + if (service is FormClients form) + { + form.ShowDialog(); + } + } } } diff --git a/FoodOrders/FoodOrders/Program.cs b/FoodOrders/FoodOrders/Program.cs index b1502d2..5e0cba4 100644 --- a/FoodOrders/FoodOrders/Program.cs +++ b/FoodOrders/FoodOrders/Program.cs @@ -39,10 +39,12 @@ namespace FoodOrders services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -55,6 +57,7 @@ namespace FoodOrders services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file