Пример #1
0
        public static void SaveAComment(Comment comm)
        {
            if (comm.text == null || comm.text.Length == 0) { return; }

            string sql = "Insert into Comments (UserId, Comment, CommentDate) values (?,?,?)";

            DbAccess.ExecuteUpdate(sql, comm.user.ID, comm.text, DateTime.Now);
        }
Пример #2
0
 protected void CommentPost_Click(object sender, EventArgs e)
 {
     if(CommentsTB.Text != null)
     {
         Comment newComm = new Comment(CommentsTB.Text, DateTime.Now, _u);
         DataAccess.SaveAComment(newComm);
         Server.Transfer(Request.Path);
     }
 }