Пример #1
0
        // *********************************************************************
        //  Roles_Command
        //
        /// <summary>
        /// This event is raised whenever the administrator works with the role
        /// based security model.  There isn't any pre-caching or confirmation
        /// when working with role based security, and all changes to the database
        /// occur immediately.
        /// </summary>
        ///
        // ********************************************************************/
        private void Roles_Command(object sender, DataGridCommandEventArgs e)
        {
            int    forumID = ForumID;
            string action  = e.CommandName;
            string role    = e.CommandArgument.ToString();

            switch (action)
            {
            case "AddRole":
                UserRoles.AddForumToRole(forumID, role);
                UpdateRoleControls(((Control)sender).Parent);
                break;

            case "RemoveRole":
                UserRoles.RemoveForumFromRole(forumID, role);
                UpdateRoleControls(((Control)sender).Parent);
                break;
            }
        }