protected void addCommentSubmit_Click(object sender, EventArgs e) { ClanciKomentari comment = new ClanciKomentari(); comment.Komentar = wysiwyg.InnerText; comment.ClanakID = articleId; comment.KorisnikID = Convert.ToInt32(User.Identity.Name); comment.DatumKreiranja = DateTime.Now; comment.DatumIzmjene = DateTime.Now; comment.Status = true; DAClanci.AddComment(comment); wysiwyg.InnerText = ""; bool newPage = false; if (commentsGrid.VirtualItemCount % commentsGrid.PageSize != 0) commentsGrid.CurrentPageIndex = commentsGrid.PageCount - 1; else if (commentsGrid.VirtualItemCount != 0) newPage = true; activateCommentTab(); BindComments(newPage); }
public static void AddComment(ClanciKomentari comment) { Connection.dm.ClanciKomentari.Add(comment); Connection.dm.SaveChanges(); }