예제 #1
0
        private void ButtonAddGame_Click(object sender, EventArgs e)
        {
            if (ComboBoxGameTitle.SelectedIndex == -1)
            {
                _ = DarkMessageBox.Show(this, "You must first specify a game title.", "No Game Title",
                                        MessageBoxIcon.Exclamation);
                return;
            }

            if (ComboBoxGameRegion.SelectedIndex == -1)
            {
                _ = DarkMessageBox.Show(this, "You must specify a game region.", "No Game Region",
                                        MessageBoxIcon.Exclamation);
                return;
            }

            var gameTitle  = ComboBoxGameTitle.GetItemText(ComboBoxGameTitle.SelectedItem);
            var gameRegion = ComboBoxGameRegion.GetItemText(ComboBoxGameRegion.SelectedItem);

            var gameId = MainWindow.Database.Categories.GetCategoryByTitle(gameTitle).Id;

            DgvGameRegions.Rows.Add(gameTitle, gameRegion);
            MainWindow.Settings.UpdateGameRegion(gameId, gameRegion);
            LoadSavedRegions();
        }
예제 #2
0
        private void ButtonAddGame_Click(object sender, EventArgs e)
        {
            if (ComboBoxGameTitle.SelectedIndex == -1)
            {
                XtraMessageBox.Show("You must first specify a game title.", "No Game Title");
                return;
            }

            if (ComboBoxGameRegion.SelectedIndex == -1)
            {
                XtraMessageBox.Show("You must specify a game region for this game.", "No Game Region");
                return;
            }

            var gameTitle  = ComboBoxGameTitle.GetItemText(ComboBoxGameTitle.SelectedItem);
            var gameRegion = ComboBoxGameRegion.GetItemText(ComboBoxGameRegion.SelectedItem);

            var gameId = MainWindow.Database.CategoriesData.GetCategoryByTitle(gameTitle).Id;

            MainWindow.Settings.UpdateGameRegion(gameId, gameRegion);
            LoadSavedGameRegions();
        }