Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int caseSwitch = SOURCE.User.getPrivilege();//  grab value from current loggedin user's privilege

            switch (caseSwitch)
            {
            // case 1 = standard user (data-entry clerk) {checkEntry only}
            case 1:
            {
                Menu menu = (Menu)WebForm1.FindControlRecursive(this.Master, "NavigationMenu");
                // Menu menu = (Menu)this.FindControl("NavigationMenu");
                MenuItemCollection menuItems = menu.Items;


                for (int i = 0; i < menuItems.Count; i++)
                {
                    if (menuItems[i].Text != "Enter Check")
                    {
                        menuItems.Remove(menuItems[i]);
                        i--;
                    }
                }
            }
            break;

            // case 2 = local treasurer user (data-entry + data-retrieval + print letters + add Level 1 users [clerks]) {plans changed - no controls will be removed now.}
            case 2:
                break;

            // case 3 = backend admin - no restrictions
            case 3:
                break;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            QueryCheckNumber.Click += new EventHandler(this.QueryBtn_Click);
            EditButton.Click       += new EventHandler(this.Edit_Click);
            DeleteButton.Click     += new EventHandler(this.Delete_Click);
            CancelButton.Click     += new EventHandler(this.Cancel_Click);
            SaveButton.Click       += new EventHandler(this.Save_Click);
            PrintButton.Click      += new EventHandler(this.Print_Click);
            int caseSwitch = SOURCE.User.getPrivilege();//  grab value from current loggedin user's privilege

            myGridView.RowDataBound         += new GridViewRowEventHandler(myGridView_RowDataBound);
            myGridView.SelectedIndexChanged += new EventHandler(myGridView_SelectedIndexChanged);

            switch (caseSwitch)
            {
            // case 1 = standard user (data-entry clerk) {checkEntry only}
            case 1:
            {
                Menu menu = (Menu)WebForm1.FindControlRecursive(this.Master, "NavigationMenu");
                // Menu menu = (Menu)this.FindControl("NavigationMenu");
                MenuItemCollection menuItems = menu.Items;


                for (int i = 0; i < menuItems.Count; i++)
                {
                    if (menuItems[i].Text != "Enter Check")
                    {
                        menuItems.Remove(menuItems[i]);
                        i--;
                    }
                }
            }
            break;

            // case 2 = local treasurer user (data-entry + data-retrieval + print letters) {removes Add User}
            case 2:
            {
                Menu menu = (Menu)WebForm1.FindControlRecursive(this.Master, "NavigationMenu");
                // Menu menu = (Menu)this.FindControl("NavigationMenu");
                MenuItemCollection menuItems = menu.Items;

                for (int i = 0; i < menuItems.Count; i++)
                {
                    if (menuItems[i].Text == "Add User")
                    {
                        menuItems.Remove(menuItems[i]);
                        i--;
                    }
                }
            }
            break;

            case 3:

                break;
            }
        }