protected void cmdDelete_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow gvr in dgItems.Rows)
                {
                    var lblCommentId = (Label)gvr.FindControl("lblCommentId");
                    var chkSelect    = (CheckBox)gvr.FindControl("chkSelect");
                    if (lblCommentId != null && chkSelect != null && chkSelect.Checked)
                    {
                        //approve
                        UserFeedback.Comment c = UserFeedback.Comment.GetComment(Convert.ToInt32(lblCommentId.Text, CultureInfo.CurrentCulture), DataProvider.ModuleQualifier);
                        c.ApprovalStatusId = ApprovalStatus.Approved.GetId();
                        c.Delete(DataProvider.ModuleQualifier);
                    }
                }

                BindData();
                this.lblMessage.Text = Localization.GetString("CommentsDeleted", LocalResourceFile);

                lblMessage.Visible = true;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        protected void cmdApprove_Click(object sender, EventArgs e)
        {
            //parse through the checked items in the list and approve them.
            try
            {
                foreach (GridViewRow gvr in dgItems.Rows)
                {
                    var commentId = (Label)gvr.FindControl("lblCommentId");
                    var cb        = (CheckBox)gvr.FindControl("chkSelect");
                    if (commentId != null && cb != null && cb.Checked)
                    {
                        //approve
                        UserFeedback.Comment c = UserFeedback.Comment.GetComment(Convert.ToInt32(commentId.Text, CultureInfo.CurrentCulture), DataProvider.ModuleQualifier);
                        c.ApprovalStatusId = ApprovalStatus.Approved.GetId();
                        c.Save(DataProvider.ModuleQualifier);

                        //TODO: we need to increment the comment count when approved.
                    }
                }

                Utility.ClearPublishCache(PortalId);
                BindData();

                this.lblMessage.Text = Localization.GetString("CommentsApproved", LocalResourceFile);

                lblMessage.Visible = true;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        private void LoadControls()
        {
            thisComment            = UserFeedback.Comment.GetComment(CommentId, DataProvider.ModuleQualifier);
            this.cmdDelete.Visible = IsAdmin;

            //load text editor entries
            var l1 = (LabelControl)LoadControl("~/controls/LabelControl.ascx");

            l1.ResourceKey = "CommentText";
            this.phCommentText.Controls.Add(l1);
            this.TeArticleText                = (TextEditor)LoadControl("~/controls/TextEditor.ascx");
            this.TeArticleText.HtmlEncode     = false;
            this.TeArticleText.TextRenderMode = "Raw";
            this.TeArticleText.Width          = 700;
            this.TeArticleText.Height         = 400;
            this.TeArticleText.ChooseMode     = false;
            this.phCommentText.Controls.Add(this.TeArticleText);

            //load approval status
            this.Ias = (ItemApproval)LoadControl(ApprovalControlToLoad);
            this.Ias.ModuleConfiguration = ModuleConfiguration;
            this.Ias.ID = System.IO.Path.GetFileNameWithoutExtension(ApprovalControlToLoad);
            this.phApproval.Controls.Add(this.Ias);
        }
        private void LoadControls()
        {
            thisComment = UserFeedback.Comment.GetComment(CommentId, DataProvider.ModuleQualifier);
            this.cmdDelete.Visible = IsAdmin;

            //load text editor entries
            var l1 = (LabelControl)LoadControl("~/controls/LabelControl.ascx");
            l1.ResourceKey = "CommentText";
            this.phCommentText.Controls.Add(l1);
            this.TeArticleText = (TextEditor)LoadControl("~/controls/TextEditor.ascx");
            this.TeArticleText.HtmlEncode = false;
            this.TeArticleText.TextRenderMode = "Raw";
            this.TeArticleText.Width = 700;
            this.TeArticleText.Height = 400;
            this.TeArticleText.ChooseMode = false;
            this.phCommentText.Controls.Add(this.TeArticleText);

            //load approval status
            this.Ias = (ItemApproval) LoadControl(ApprovalControlToLoad);
            this.Ias.ModuleConfiguration = ModuleConfiguration;
            this.Ias.ID = System.IO.Path.GetFileNameWithoutExtension(ApprovalControlToLoad);
            this.phApproval.Controls.Add(this.Ias);
        }