private void homeToolStripMenuItem_Click(object sender, EventArgs e) { if (fHome == null) { fHome = new FormHome(); } fHome.MdiParent = this; fHome.Show(); fHome.Activate(); }
private void MainMenu_Load(object sender, EventArgs e) { FormLogin lg = new FormLogin(); lg.ShowDialog(); this.Current_Account = lg.Account; if (Current_Account.Power.Equals("admin")) { suppliersToolStripMenuItem.Enabled = true; categorysToolStripMenuItem.Enabled = true; addNewProductsToolStripMenuItem.Enabled = true; listOfProductsToolStripMenuItem.Enabled = true; MakeBillsToolStripMenuItem.Enabled = true; listBillsToolStripMenuItem.Enabled = true; addStaffToolStripMenuItem.Enabled = true; listStaffsToolStripMenuItem.Enabled = true; customerEmailToolStripMenuItem.Enabled = true; reportToolStripMenuItem.Enabled = true; } if (Current_Account.Power.Equals("Sales staff")) { MakeBillsToolStripMenuItem.Enabled = true; listBillsToolStripMenuItem.Enabled = true; reportToolStripMenuItem.Enabled = true; } if (Current_Account.Power.Equals("Warehouse staff")) { suppliersToolStripMenuItem.Enabled = true; categorysToolStripMenuItem.Enabled = true; addNewProductsToolStripMenuItem.Enabled = true; listOfProductsToolStripMenuItem.Enabled = true; } //Load FormHome if (fHome == null) { fHome = new FormHome(); } fHome.Current_acc = this.Current_Account.User; fHome.MdiParent = this; fHome.Show(); fHome.Activate(); }