private void LoadComments(int contestEntryId)
        {
            DataTable dtComments   = ContestCommentBLL.ListByContestEntryID(contestEntryId);
            int       commentLimit = 2;

            foreach (DataRow dr in dtComments.Rows)
            {
                if (commentLimit > 0)
                {
                    frontrunnerComments.InnerHtml +=
                        "<b>" + dr["ScreenName"] + " says:</b>" +
                        "<br>" +
                        dr["Comment"] +
                        "<br><br>";
                }

                commentLimit--;
            }

            if (dtComments.Rows.Count > 2)
            {
                frontrunnerViewComments.Attributes.Add("href", "view-comments.aspx?id=" + contestEntryId);
                frontrunnerViewComments.InnerHtml = string.Format("View all comments ({0})", dtComments.Rows.Count);
            }
        }
예제 #2
0
        private void SaveComment(ContestJudgeBLL judge)
        {
            ContestCommentBLL comment = new ContestCommentBLL();

            comment.Comment        = tbxJudgeComment.Text;
            comment.ContestEntryID = (int)judge.VoteContestEntryID;
            comment.ContestJudgeID = judge.ContestJudgeID;
            comment.Save();
        }
        protected void btnSaveComment_Click(object sender, EventArgs e)
        {
            if (Session["ContestJudge"] != null && Request["id"] != null && tbxJudgeComment.Text != string.Empty)
            {
                int contestEntryId = 0;
                int.TryParse(Request["id"], out contestEntryId);

                if (contestEntryId > 0)
                {
                    ContestJudgeBLL   judge   = (ContestJudgeBLL)Session["ContestJudge"];
                    ContestCommentBLL comment = new ContestCommentBLL();
                    comment.Comment        = tbxJudgeComment.Text;
                    comment.ContestEntryID = contestEntryId;
                    comment.ContestJudgeID = judge.ContestJudgeID;
                    comment.Save();

                    tbxJudgeComment.Text = string.Empty;

                    LoadPage();
                }
            }
        }
 private void LoadComments(int contestEntryId)
 {
     repComments.DataSource = ContestCommentBLL.ListByContestEntryID(contestEntryId);
     repComments.DataBind();
 }