private void addPlayerToolStripMenuItem_Click(object sender, EventArgs e) { if (DbNotLoadedAlert()) { return; } EditPlayerDialog addDialog = new EditPlayerDialog(); if(addDialog.ShowDialog() == DialogResult.OK) { dbMgr.InsertPlayer(addDialog.GetPlayer()); ReloadPlayersAndView(); //TODO just add to the in-memory list, do not load entire DB } }
private void EditPlayer(Player player) { EditPlayerDialog editDialog = new EditPlayerDialog(player); if(editDialog.ShowDialog() == DialogResult.OK) { dbMgr.UpdatePlayer(editDialog.GetPlayer()); ReloadPlayersAndView(); //TODO just update the item } }