Example #1
0
        protected void btnSendReply_Click(object sender, EventArgs e)
        {
            int     parentId = Convert.ToInt32(fcommentId.Value);
            int     postId   = Convert.ToInt32(fpostId.Value);
            string  content  = txtReply.Text;
            int     userId   = Convert.ToInt32(Session["UserId"].ToString());
            Comment comment  = new Comment {
                PostId = postId, Content = content, ParentId = parentId, UserId = userId
            };

            CommentRepo.InsertComment(comment);
            Response.Redirect($"/posts/{postId}/");
        }
Example #2
0
 public void InsertComment(Comment comment)
 {
     repo.InsertComment(comment);
 }
Example #3
0
 public void InsertComment(Comment c)
 {
     c.Date = DateTime.Now;
     repo.InsertComment(c);
 }