private void UpdateGameOfficial() { int si = 0; try { si = lvOfficial.SelectedItems[0].Index; } catch { MessageBox.Show("Please select you want to update"); return; } GameOfficial official = new GameOfficial() { firstName = listGameOfficial[si].firstName, lastName = listGameOfficial[si].lastName, officialID = listGameOfficial[si].officialID }; using (Form f = new frmAddGameOfficial(official)) { if (DialogResult.OK == f.ShowDialog()) { MessageBox.Show("Sucessfully updated official"); DisplayGameOfficial(); } } }
private void AddGameOfficial() { GameOfficial official = new GameOfficial(); using (Form f = new frmAddGameOfficial(official)) { if (DialogResult.OK == f.ShowDialog()) { MessageBox.Show("Sucessfully added official"); DisplayGameOfficial(); } } }