Beispiel #1
0
        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
            }
        }
Beispiel #2
0
 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
     }
 }