Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        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);
            }
        }