Beispiel #1
0
 /// <summary>
 /// New role click handler.
 /// </summary>
 private void btnNewRole_Click(object sender, EventArgs e)
 {
     RoleID = RoleEdit.ItemID = Role.ItemID = 0;
     RoleEdit.ReloadData(true);
     SelectedControl = "newrole";
     DisplayControls(SelectedControl);
 }
    /// <summary>
    /// Reloads and displays appropriate controls.
    /// </summary>
    public override void ReloadData(bool forceReload)
    {
        RoleEdit.ItemID      = RoleUsers.RoleID = ItemID;
        RoleEdit.SiteID      = SiteID;
        RoleEdit.DisplayMode = DisplayMode;
        RoleEdit.ReloadData(forceReload);

        RoleEdit.Visible  = false;
        RoleUsers.Visible = false;

        tabMenu.SelectedTab = SelectedTab;

        switch (SelectedTab)
        {
        case 0:
        default:
            RoleEdit.Visible = true;
            break;

        case 1:
            RoleUsers.Visible = true;
            RoleUsers.ReloadData();
            break;
        }
    }
Beispiel #3
0
    /// <summary>
    /// Displays appropriate controls.
    /// </summary>
    public void DisplayControls(string control)
    {
        // Hide all controls first and set all IDs
        Role.Visible                = false;
        RoleList.Visible            = false;
        RoleEdit.Visible            = false;
        headerLinks.Visible         = false;
        pnlRolesBreadcrumbs.Visible = false;

        // Display edit control
        if (RoleID > 0)
        {
            Role.Visible = true;
            pnlRolesBreadcrumbs.Visible = true;
            RoleInfo role = RoleInfoProvider.GetRoleInfo(RoleID);
            if (role != null)
            {
                lblRole.ResourceString = HTMLHelper.HTMLEncode(role.DisplayName);
            }

            Role.SiteID = SiteID;
            Role.ItemID = RoleID;
            Role.ReloadData(false);
        }
        else
        {
            switch (control)
            {
            // Display list control
            case "general":
            default:
                RoleList.Visible    = true;
                headerLinks.Visible = true;
                RoleList.SiteID     = SiteID;
                RoleEdit.SiteID     = SiteID;
                RoleEdit.ReloadData(false);
                break;

            // Display new control
            case "newrole":
                RoleEdit.Visible            = true;
                pnlRolesBreadcrumbs.Visible = true;
                lblRole.ResourceString      = "Administration-Role_New.Title";
                break;
            }
        }
    }
Beispiel #4
0
    /// <summary>
    /// Displays appropriate controls.
    /// </summary>
    public void DisplayControls(string control)
    {
        // Hide all controls first and set all IDs
        Role.Visible                = false;
        RoleList.Visible            = false;
        RoleEdit.Visible            = false;
        headerLinks.Visible         = false;
        pnlRolesBreadcrumbs.Visible = false;

        // Display edit control
        if (RoleID > 0)
        {
            Role.Visible = true;
            pnlRolesBreadcrumbs.Visible = true;
            InitializeBreadcrumbs();

            Role.SiteID = SiteID;
            Role.ItemID = RoleID;
            Role.ReloadData(false);
        }
        else
        {
            switch (control)
            {
            // Display list control
            case "general":
            default:
                RoleList.Visible    = true;
                headerLinks.Visible = true;
                RoleList.SiteID     = SiteID;
                RoleEdit.SiteID     = SiteID;
                RoleEdit.ReloadData(false);
                break;

            // Display new control
            case "newrole":
                RoleEdit.Visible            = true;
                pnlRolesBreadcrumbs.Visible = true;
                InitializeBreadcrumbs();
                break;
            }
        }
    }