Beispiel #1
0
        static void Main(string[] args)
        {
            //Add new gamer-user
            Gamer gamer1 = new Gamer {
                Id = 1, FirstName = "Ali"
            };                                                        //valid
            Gamer gamer2 = new Gamer {
                Id = 4, FirstName = "Ahmet"
            };                                                        //not valid

            //Add new Game
            Game game1 = new Game {
                Id = 1, Name = "Futbol", Price = 100
            };

            //Add new Discount
            Discount discount1 = new Discount {
                Amount = 25, Name = "Sezon"
            };

            //Validation instance ı oluşturuldu.
            GamerManager gamerControl = new GamerManager(new ValidationManager());

            gamerControl.Add(gamer1);

            //Game instance ı oluşturuldu.
            GameSaleManager gameManager = new GameSaleManager(new ValidationManager(), new DiscountManager());

            gameManager.Buy(gamer2, game1);
            gameManager.DicountSale(game1, discount1);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                Id = 1, FirstName = "FATMA", LastName = "KOYUNCU", BirthYear = 1997, IdentityNumber = 54321
            });

            GameCompanyManager gameCompanyManager = new GameCompanyManager();

            gameCompanyManager.Add(new GameCompany {
                Id = 1, CompanyName = "Yaz İndirimi", CompanyDetails = "sepette %20 indirim"
            });

            GameSaleManager gameSaleManager = new GameSaleManager();

            gameSaleManager.Buy(new GameSale {
                Id = 1, GameName = "PUBG", GamePrice = 150
            }, new Gamer {
                FirstName = "Ali", LastName = "Kaya"
            });



            Console.ReadLine();
        }