예제 #1
0
        private void updateGameBtn_Click(object sender, EventArgs e)
        {
            if (titleTxt.Text != "" && priceTxt.Text != "")
            {
                VideoGame updateGame = (VideoGame)gameLstBox.SelectedItem;
                updateGame.Title  = titleTxt.Text;
                updateGame.Price  = Convert.ToDouble(priceTxt.Text);
                updateGame.Rating = ratingCmbBxox.Text;
                VideoGameDb.Update(updateGame);
                gameLstBox.Items.Clear();
                List <VideoGame> games = VideoGameDb.GetVideoGames();
                foreach (VideoGame g in games)
                {
                    gameLstBox.Items.Add(g);
                }

                ClearData();
            }
        }