Добавлены пункты меню про магазины в главную форму и реализована логика их работы

This commit is contained in:
Никита Потапов 2024-03-11 10:48:07 +04:00
parent 3bd74e082c
commit c194b36266
2 changed files with 25 additions and 7 deletions

View File

@ -32,13 +32,14 @@
справочникиToolStripMenuItem = new ToolStripMenuItem(); справочникиToolStripMenuItem = new ToolStripMenuItem();
ComponentsToolStripMenuItem = new ToolStripMenuItem(); ComponentsToolStripMenuItem = new ToolStripMenuItem();
SecuresToolStripMenuItem = new ToolStripMenuItem(); SecuresToolStripMenuItem = new ToolStripMenuItem();
магазиныToolStripMenuItem = new ToolStripMenuItem();
dataGridView = new DataGridView(); dataGridView = new DataGridView();
buttonCreateOrder = new Button(); buttonCreateOrder = new Button();
buttonTakeOrderInWork = new Button(); buttonTakeOrderInWork = new Button();
buttonOrderReady = new Button(); buttonOrderReady = new Button();
button4 = new Button(); button4 = new Button();
buttonRefresh = new Button(); buttonRefresh = new Button();
магазиныToolStripMenuItem = new ToolStripMenuItem(); пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem();
menuStrip.SuspendLayout(); menuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout(); SuspendLayout();
@ -46,7 +47,7 @@
// menuStrip // menuStrip
// //
menuStrip.ImageScalingSize = new Size(20, 20); menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem }); menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, пополнениеМагазинаToolStripMenuItem });
menuStrip.Location = new Point(0, 0); menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip"; menuStrip.Name = "menuStrip";
menuStrip.Size = new Size(1043, 28); menuStrip.Size = new Size(1043, 28);
@ -74,6 +75,13 @@
SecuresToolStripMenuItem.Text = "Изделия"; SecuresToolStripMenuItem.Text = "Изделия";
SecuresToolStripMenuItem.Click += SecuresToolStripMenuItem_Click; SecuresToolStripMenuItem.Click += SecuresToolStripMenuItem_Click;
// //
// магазиныToolStripMenuItem
//
магазиныToolStripMenuItem.Name = агазиныToolStripMenuItem";
магазиныToolStripMenuItem.Size = new Size(224, 26);
магазиныToolStripMenuItem.Text = "Магазины";
магазиныToolStripMenuItem.Click += ShopsToolStripMenuItem_Click;
//
// dataGridView // dataGridView
// //
dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
@ -143,12 +151,12 @@
buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.UseVisualStyleBackColor = true;
buttonRefresh.Click += ButtonRefresh_Click; buttonRefresh.Click += ButtonRefresh_Click;
// //
// магазиныToolStripMenuItem // пополнениеМагазинаToolStripMenuItem
// //
магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem";
магазиныToolStripMenuItem.Size = new Size(224, 26); пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24);
магазиныToolStripMenuItem.Text = "Магазины"; пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина";
магазиныToolStripMenuItem.Click += ShopsToolStripMenuItem_Click; пополнениеМагазинаToolStripMenuItem.Click += SupplyShopToolStripMenuItem_Click;
// //
// FormMain // FormMain
// //
@ -186,5 +194,6 @@
private Button button4; private Button button4;
private Button buttonRefresh; private Button buttonRefresh;
private ToolStripMenuItem магазиныToolStripMenuItem; private ToolStripMenuItem магазиныToolStripMenuItem;
private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem;
} }
} }

View File

@ -145,5 +145,14 @@ namespace SecuritySystemView
form.ShowDialog(); form.ShowDialog();
} }
} }
private void SupplyShopToolStripMenuItem_Click(object sender, EventArgs e)
{
var service = Program.ServiceProvider?.GetService(typeof(FormShopSupply));
if (service is FormShopSupply form)
{
form.ShowDialog();
}
}
} }
} }