Ejemplo n.º 1
0
        private void generalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                pnlMail.Controls.Clear();
                Ganeral frmganaral = new Ganeral();
                DisableMenuscolors();
                generalToolStripMenuItem.BackColor = Color.SteelBlue;
                frmganaral.Dock            = DockStyle.Fill;
                frmganaral.TopLevel        = false;
                frmganaral.FormBorderStyle = FormBorderStyle.None;

                pnlMail.Controls.Add(frmganaral);
                frmganaral.Visible = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Ejemplo n.º 2
0
        public void VisableMenus()
        {
            if (!Login.IsAdmin)
            {
                if (Login.AllowItemMnagement)
                {
                    itemManagementToolStripMenuItem.Visible = true;

                    //  tbAddItem.
                }

                else
                {
                    itemManagementToolStripMenuItem.Visible = false;
                }

                if (Login.AllowJobs)
                {
                    jobsToolStripMenuItem.Visible = true;
                }
                else
                {
                    jobsToolStripMenuItem.Visible = false;
                }

                if (Login.AllowReports)
                {
                    reportsToolStripMenuItem.Visible = true;
                }
                else
                {
                    reportsToolStripMenuItem.Visible = false;
                }

                loadItemMgmnt();
            }
            else
            {
                if (Login.AllowGeneral)
                {
                    DisableMenuscolors();
                    generalToolStripMenuItem.BackColor = Color.SteelBlue;
                    generalToolStripMenuItem.Visible   = true;

                    pnlMail.Controls.Clear();
                    Ganeral frmganaral = new Ganeral();

                    frmganaral.Dock            = DockStyle.Fill;
                    frmganaral.TopLevel        = false;
                    frmganaral.FormBorderStyle = FormBorderStyle.None;

                    pnlMail.Controls.Add(frmganaral);
                    frmganaral.Visible = true;
                }
                else
                {
                    generalToolStripMenuItem.Visible = false;
                }

                if (Login.AllowItemMnagement)
                {
                    itemManagementToolStripMenuItem.Visible = true;
                }
                else
                {
                    itemManagementToolStripMenuItem.Visible = false;
                }

                if (Login.AllowInventory)
                {
                    inventoryToolStripMenuItem.Visible = true;
                }
                else
                {
                    inventoryToolStripMenuItem.Visible = false;
                }

                if (Login.AllowJobs)
                {
                    jobsToolStripMenuItem.Visible = true;
                }
                else
                {
                    jobsToolStripMenuItem.Visible = false;
                }

                if (Login.AllowReports)
                {
                    reportsToolStripMenuItem.Visible = true;
                }
                else
                {
                    reportsToolStripMenuItem.Visible = false;
                }

                if (Login.AllowSupplier)
                {
                    supplierToolStripMenuItem.Visible = true;
                }
                else
                {
                    supplierToolStripMenuItem.Visible = false;
                }

                //if (Login.AllowConfiguration)
                //    configurationToolStripMenuItem.Visible = true;
                //else
                //    configurationToolStripMenuItem.Visible = false;
            }
        }