Exemplo n.º 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}/");
        }
Exemplo n.º 2
0
 public void InsertComment(Comment comment)
 {
     repo.InsertComment(comment);
 }
Exemplo n.º 3
0
 public void InsertComment(Comment c)
 {
     c.Date = DateTime.Now;
     repo.InsertComment(c);
 }