/// <summary>
    /// Handles the UniGrids's OnAction event.
    /// </summary>
    /// <param name="actionName">Name of item (button) that throws event</param>
    /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param>
    protected void gridElem_OnAction(string actionName, object actionArgument)
    {
        switch (actionName.ToLowerCSafe())
        {
        case "delete":
        case "up":
        case "down":
            if (!CheckPermissions("cms.forums", PERMISSION_MODIFY))
            {
                return;
            }
            break;
        }

        switch (actionName.ToLowerCSafe())
        {
        case "delete":
            ForumInfoProvider.DeleteForumInfo(Convert.ToInt32(actionArgument));
            break;

        case "up":
            ForumInfoProvider.MoveForumUp(Convert.ToInt32(actionArgument));
            break;

        case "down":
            ForumInfoProvider.MoveForumDown(Convert.ToInt32(actionArgument));
            break;
        }

        RaiseOnAction(actionName, actionArgument);
    }
    /// <summary>
    /// Deletes forum. Called when the "Delete forum" button is pressed.
    /// Expects the CreateForum method to be run first.
    /// </summary>
    private bool DeleteForum()
    {
        // Get the forum
        ForumInfo deleteForum = ForumInfoProvider.GetForumInfo("MyNewForum", CMSContext.CurrentSiteID);

        // Delete the forum
        ForumInfoProvider.DeleteForumInfo(deleteForum);

        return(deleteForum != null);
    }
Esempio n. 3
0
    /// <summary>
    /// Actions handler.
    /// </summary>
    void btnDelete_Click(object sender, EventArgs e)
    {
        if (!CheckPermissions("cms.forums", CMSAdminControl.PERMISSION_MODIFY))
        {
            return;
        }

        ForumInfoProvider.DeleteForumInfo(ValidationHelper.GetInteger(hdnForumId.Value, 0));
        ltlScript.Text += ScriptHelper.GetScript("parent.frames['main'].location.href = '" + ResolveUrl("~/CMSPages/blank.htm") + "'");
        ltlScript.Text += ScriptHelper.GetScript("window.location.replace(window.location);");
    }
Esempio n. 4
0
    /// <summary>
    /// Actions handler.
    /// </summary>
    protected void HeaderActions_ActionPerformed(object sender, CommandEventArgs e)
    {
        switch (e.CommandName.ToLowerCSafe())
        {
        case "delete":
            if (!CheckPermissions("cms.forums", CMSAdminControl.PERMISSION_MODIFY))
            {
                return;
            }

            ForumInfoProvider.DeleteForumInfo(ValidationHelper.GetInteger(hdnForumId.Value, 0));
            ltlScript.Text += ScriptHelper.GetScript("parent.frames['main'].location.href = '" + ResolveUrl("~/CMSPages/blank.htm") + "'");
            ltlScript.Text += ScriptHelper.GetScript("window.location.replace(window.location);");
            break;
        }
    }
Esempio n. 5
0
    private void Control_OnAction(string actionName, object actionArgument)
    {
        switch (actionName.ToLowerCSafe())
        {
        case "delete":
            ForumInfoProvider.DeleteForumInfo(ValidationHelper.GetInteger(actionArgument, 0));
            break;

        case "up":
            ForumInfoProvider.MoveForumUp(ValidationHelper.GetInteger(actionArgument, 0));
            break;

        case "down":
            ForumInfoProvider.MoveForumDown(ValidationHelper.GetInteger(actionArgument, 0));
            break;
        }
    }