Фикс главной формы Лаб5

This commit is contained in:
Артем Харламов 2023-04-28 00:06:15 +04:00
parent 79a61aca11
commit 337b7b390e
3 changed files with 25 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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();
}
}
}
}

View File

@ -39,10 +39,12 @@ namespace FoodOrders
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IDishStorage, DishStorage>();
services.AddTransient<IClientStorage, ClientStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IDishLogic, DishLogic>();
services.AddTransient<IReportLogic, ReportLogic>();
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<AbstractSaveToExcel, SaveToExcel>();
services.AddTransient<AbstractSaveToWord, SaveToWord>();
services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
@ -55,6 +57,7 @@ namespace FoodOrders
services.AddTransient<FormDishes>();
services.AddTransient<FormReportDishComponents>();
services.AddTransient<FormReportOrders>();
services.AddTransient<FormClients>();
}
}
}