private void btnCommentCrudAdd_Click(object sender, EventArgs e) { CommentEntity comment = new CommentEntity(); CRUD_Comment crudComment = new CRUD_Comment(comment, login.Id); crudComment.ShowDialog(); if (crudComment.DialogResult == DialogResult.OK) { AllComments.Add(comment); dgvCommentTable.Invalidate(); } }
private void btnCommentCrudEdit_Click(object sender, EventArgs e) { int commentIndex = dgvCommentTable.CurrentCell.RowIndex; CommentEntity comment = AllComments.ElementAt(commentIndex); CRUD_Comment crudComment = new CRUD_Comment(comment); crudComment.ShowDialog(); if (crudComment.DialogResult == DialogResult.OK) { dgvCommentTable.InvalidateRow(commentIndex); } }