示例#1
0
        /// <summary>
        /// Delete The Forum
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Save_Click([NotNull] object sender, [NotNull] EventArgs e)
        {
            string errorMessage;

            if (this.MoveTopics.Checked)
            {
                // Simply Delete the Forum with all of its Content
                var forumId = this.GetQueryStringAsInt("fa");

                // schedule...
                ForumDeleteTask.Start(
                    this.PageContext.PageBoardID, forumId.Value, this.ForumList.SelectedValue.ToType <int>(), out errorMessage);

                // enable timer...
                this.UpdateStatusTimer.Enabled = true;

                this.LocalizedLabel6.LocalizedTag = "DELETE_MOVE_TITLE";

                // show blocking ui...
                this.PageContext.PageElements.RegisterJsBlockStartup(
                    "BlockUIExecuteJs", JavaScriptBlocks.BlockUIExecuteJs("DeleteForumMessage"));
            }
            else
            {
                // Simply Delete the Forum with all of its Content
                var forumId = this.GetQueryStringAsInt("fa");

                // schedule...
                ForumDeleteTask.Start(this.PageContext.PageBoardID, forumId.Value, out errorMessage);

                // enable timer...
                this.UpdateStatusTimer.Enabled = true;

                this.LocalizedLabel6.LocalizedTag = "DELETE_TITLE";

                // show blocking ui...
                this.PageContext.PageElements.RegisterJsBlockStartup(
                    "BlockUIExecuteJs", JavaScriptBlocks.BlockUIExecuteJs("DeleteForumMessage"));
            }

            // show blocking ui...
            this.PageContext.PageElements.RegisterJsBlockStartup(
                "BlockUIExecuteJs", JavaScriptBlocks.BlockUIExecuteJs("DeleteForumMessage"));

            if (errorMessage.IsSet())
            {
                this.PageContext.AddLoadMessage(errorMessage, MessageTypes.Error);
            }
        }
示例#2
0
        /// <summary>
        /// The forum list_ item command.
        /// </summary>
        /// <param name="source">
        /// The source.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void ForumList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "edit":
                YafBuildLink.Redirect(ForumPages.admin_editforum, "f={0}", e.CommandArgument);
                break;

            case "delete":

                // schedule...
                ForumDeleteTask.Start(PageContext.PageBoardID, Convert.ToInt32(e.CommandArgument));

                // enable timer...
                this.UpdateStatusTimer.Enabled = true;

                // show blocking ui...
                PageContext.PageElements.RegisterJsBlockStartup("BlockUIExecuteJs", JavaScriptBlocks.BlockUIExecuteJs("DeleteForumMessage "));
                break;
            }
        }
示例#3
0
        /// <summary>
        /// Delete The Forum
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void SaveClick([NotNull] object sender, [NotNull] EventArgs e)
        {
            string errorMessage;

            if (this.MoveTopics.Checked)
            {
                // Simply Delete the Forum with all of its Content
                var forumId = this.Get <HttpRequestBase>().QueryString.GetFirstOrDefaultAsInt("fa");

                // schedule...
                ForumDeleteTask.Start(
                    this.PageContext.PageBoardID,
                    forumId.Value,
                    this.ForumList.SelectedValue.ToType <int>(),
                    out errorMessage);

                // enable timer...
                this.UpdateStatusTimer.Enabled = true;

                this.LocalizedLabel6.LocalizedTag = "DELETE_MOVE_TITLE";
            }
            else
            {
                // Simply Delete the Forum with all of its Content
                var forumId = this.Get <HttpRequestBase>().QueryString.GetFirstOrDefaultAsInt("fa");

                // schedule...
                ForumDeleteTask.Start(this.PageContext.PageBoardID, forumId.Value, out errorMessage);

                // enable timer...
                this.UpdateStatusTimer.Enabled = true;

                this.LocalizedLabel6.LocalizedTag = "DELETE_TITLE";
            }

            if (errorMessage.IsSet())
            {
                this.PageContext.AddLoadMessage(errorMessage, MessageTypes.danger);
            }
        }