Beispiel #1
0
        private void btnUserAdd_Click(object sender, EventArgs e)
        {
            UserEntity user     = new UserEntity();
            CRUD_User  crudUser = new CRUD_User(user);

            crudUser.ShowDialog();
            if (crudUser.DialogResult == DialogResult.OK)
            {
                AllUsers.Add(user);
                dgvUserTable.Invalidate();
            }
        }
Beispiel #2
0
        private void btnUserEdit_Click(object sender, EventArgs e)
        {
            int        userIndex = dgvUserTable.CurrentCell.RowIndex;
            UserEntity user      = AllUsers.ElementAt(userIndex);

            CRUD_User crudUser = new CRUD_User(user);

            crudUser.editing = true;
            crudUser.ShowDialog();

            if (crudUser.DialogResult == DialogResult.OK)
            {
                dgvUserTable.InvalidateRow(userIndex);
            }
        }