Beispiel #1
0
        void OpenGameInfo(string name)
        {
            var gameToDisplay = UIController.PrepareGameToDisplay(DBController.GetGameByName(name));
            var gameInfoForm  = new GameInfoForm(gameToDisplay);

            gameInfoForm.GameBoughtEvent += GameBought;
            gameInfoForm.Show();
        }
Beispiel #2
0
        bool CheckAvailability(string name)
        {
            var currentGameCount = (from game in UIController.currentOrderGames
                                    where game.Item1 == name
                                    select game).Count();
            var availableGames = DBController.GetGameByName(name).Quantity;

            return(availableGames > currentGameCount);
        }
Beispiel #3
0
        private void OrderButton_Click(object sender, EventArgs e)
        {
            var currentOrderGameParams = new List <GameParams>();
            var groupedGames           = from game in UIController.currentOrderGames group game by game.Item1;

            foreach (var game in groupedGames)
            {
                var currentGame = DBController.GetGameByName(game.Key);
                currentGame.Quantity = game.Count();
                currentOrderGameParams.Add(currentGame);
            }
            var orderConfirmationForm = new OrderConfirmationForm(currentOrderGameParams);

            Hide();
            if (orderConfirmationForm.ShowDialog() == DialogResult.OK)
            {
                OnCartClear();
            }
            Dispose();
        }