Beispiel #1
0
        private void setColorScheme()
        {
            Color primaryColor;
            Color secondaryColor;

            if (currentUser.isAdmin())
            {
                newCustomerBtn.Visible = false;
                primaryColor           = Color.Goldenrod;
                secondaryColor         = Color.SteelBlue;
            }
            else
            {
                adminBtn.Visible = false;
                primaryColor     = Color.SteelBlue;
                secondaryColor   = Color.Goldenrod;
            }

            this.BackColor = primaryColor;
            GlobalControl.setNestedButtonColor(this, secondaryColor);
            rentBtn.BackColor        = Color.SlateGray;
            newCustomerBtn.BackColor = Color.PaleVioletRed;
            returnBtn.BackColor      = Color.ForestGreen;
            reportsBtn.BackColor     = Color.DarkGoldenrod;
            adminBtn.BackColor       = Color.Crimson;

            tabPage1.BackColor  = secondaryColor;
            tabPage2.BackColor  = secondaryColor;
            tabPage3.BackColor  = secondaryColor;
            tabPage4.BackColor  = secondaryColor;
            tabPage5.BackColor  = secondaryColor;
            tabPage6.BackColor  = secondaryColor;
            tabPage7.BackColor  = secondaryColor;
            tabPage8.BackColor  = secondaryColor;
            tabPage9.BackColor  = secondaryColor;
            tabPage10.BackColor = secondaryColor;

            admin1Btn.BackColor        = primaryColor;
            admin2Btn.BackColor        = primaryColor;
            admin3Btn.BackColor        = primaryColor;
            admin4Btn.BackColor        = primaryColor;
            admin5Btn.BackColor        = primaryColor;
            admin6Btn.BackColor        = primaryColor;
            admin7Btn.BackColor        = primaryColor;
            admin8Btn.BackColor        = primaryColor;
            adminPasswordBtn.BackColor = primaryColor;
        }
Beispiel #2
0
        /*
         * ----------------------------------------------------------------------------------------------
         * Part 2: Initialization methods and events
         * ----------------------------------------------------------------------------------------------
         */

        public MainMenu(User user, Form loginMenu)
        {
            this.loginMenu = loginMenu;

            currentUser = user;
            InitializeComponent();

            //restricts max chars in all textboxes
            GlobalControl.setNestedTextBoxMaxLength(this, 40);
            setEmailTextBoxSize(100);

            //assigns a setup method to each panel
            assignPanelSetupDelagates();

            //sets report panel to initial panel
            setCurrentMainPanel(rentPnl);
        }