示例#1
0
        public bool PostComment(CommentDTO comment)
        {
            string sql = "sp_News_PostComment";
            List<SqlParameter> list = new List<SqlParameter>();

            list.Add(new SqlParameter("@ID_News", comment.ID_News));
            list.Add(new SqlParameter("@ID_GDV", comment.ID_GDV));
            list.Add(new SqlParameter("@TimeComment", comment.TimmeComment));
            list.Add(new SqlParameter("@Comments", comment.Comments));

            return SqlDataAcessHelper.exNonStoreParas(sql, list);
        }
示例#2
0
        protected void btnPost_Click(object sender, EventArgs e)
        {
            int idNews = int.Parse(hiddenIDNews.Value);
            int idgdv = int.Parse(Request.Cookies["MaGDV"].Value);

            CommentDTO comment = new CommentDTO();
            comment.ID_News = idNews;
            comment.ID_GDV = idgdv;
            comment.Comments = txtComment.Text.ToString();

            daoComment.PostComment(comment);

            loadComment(idNews);
            txtComment.Text = "";
        }