/// <summary> /// Adds a reply to database /// </summary> /// <param name="message">Content of the reply</param> private void AddReply(string message) { var r = new Reply(0, _activeUser.ID, _event.ID, 0, _post.ID, DateTime.Now, true, message); if (_logicPost.InsertPost(r) == null) MessageBox.Show("Er is iets misgegaan"); LoadReplies(); }
private void LoadPost(Reply post) { var i = 0; if (post.MainPostID == 0) { if (i <= 5) { // Post are getting loaded here on the timeline tableLayoutPanel1.RowCount += 1; if (_user != null) { tableLayoutPanel1.Controls.Add(new PostFeed(post, _event, _user, false), 0, i); } else { tableLayoutPanel1.Controls.Add(new PostFeed(post, _event, _admin, false), 0, i); } i++; } } }
public Reply InsertPost(Reply reply) { return _context.Insert(reply); }
public Reply Insert(Reply entity) { if (GetById(entity.ID) != null) return null; var id = _posts.Max(e => e.ID); var reply = new Reply(id, entity.GuestID, entity.EventID, entity.MediaID, entity.MainPostID, entity.Date, entity.Visible, entity.Content); _replies.Add(reply); return reply; }