Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CmdUndoFlagClick(object sender, EventArgs e)
        {
            if (tempId.Text.Trim() != string.Empty)
            {
                var objModeration = new ModerationLogInfo
                {
                    ModLogTypeId = (int)Constants.ModerationLogType.RemoveFlag,
                    PostId       = Convert.ToInt32(tempId.Text)
                };

                FlagPost(this, new FlagPostEventArgs <ModerationLogInfo>(objModeration));

                if (Model.Question.PostId == objModeration.PostId)
                {
                    // undoing a flagged question
                    Response.Redirect(Links.ViewQuestion(Model.Question.PostId, Model.Question.Title, ModuleContext.PortalSettings.ActiveTab, ModuleContext.PortalSettings), true);
                }
                else
                {
                    // undoing a flagged answer
                    rptAnswers.DataSource = Model.ColAnswers;
                    rptAnswers.DataBind();
                }
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CmdDeleteQuestionClick(object sender, EventArgs e)
        {
            // verify the user can still flag a question (operation threshold, what they have done today, etc.)
            var objModeration = new ModerationLogInfo
            {
                ModLogTypeId = Convert.ToInt32(rblstDeleteQuestion.SelectedValue),
                PostId       = Model.Question.PostId
            };

            if (objModeration.ModLogTypeId == (int)Constants.ModerationLogType.DeleteOther)
            {
                objModeration.Notes = txtDeleteQuestionOther.Text;
            }

            DeletePost(this, new DeletePostEventArgs <ModerationLogInfo>(objModeration));
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CmdFlagQuestionClick(object sender, EventArgs e)
        {
            // verify the user can still flag a question (operation threshold, what they have done today, etc.)
            var objModeration = new ModerationLogInfo
            {
                ModLogTypeId = Convert.ToInt32(rblstFlagQuestion.SelectedValue),
                PostId       = Model.Question.PostId
            };

            if (objModeration.ModLogTypeId == (int)Constants.ModerationLogType.FlagOther)
            {
                objModeration.Notes = txtFlagQuestionOther.Text;
            }

            FlagPost(this, new FlagPostEventArgs <ModerationLogInfo>(objModeration));

            Response.Redirect(Links.ViewQuestion(Model.Question.PostId, Model.Question.Title, ModuleContext.PortalSettings.ActiveTab, ModuleContext.PortalSettings), true);
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CmdFlagAnswerClick(object sender, EventArgs e)
        {
            // verify the user can still flag a question (operation threshold, what they have done today, etc.)
            if (tempId.Text.Trim() != string.Empty)
            {
                var objModeration = new ModerationLogInfo
                {
                    ModLogTypeId = Convert.ToInt32(rblstAnswerFlag.SelectedValue),
                    PostId       = Convert.ToInt32(tempId.Text)
                };

                if (objModeration.ModLogTypeId == (int)Constants.ModerationLogType.FlagOther)
                {
                    objModeration.Notes = txtFlagQuestionOther.Text;
                }

                FlagPost(this, new FlagPostEventArgs <ModerationLogInfo>(objModeration));

                rptAnswers.DataSource = Model.ColAnswers;
                rptAnswers.DataBind();
            }
        }