private void NewItem(object sender, EventArgs e) { var newUser = new UserForm(); var result = newUser.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { RefreshItems(sender, e); } }
private void UpdateItem(object sender, EventArgs e) { var user = dataGridView.SelectedRows[0].DataBoundItem as User; var newUser = new UserForm(user.Id); var result = newUser.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { RefreshItems(sender, e); } }