Пример #1
0
        static void Main(string[] args)
        {
            Player player = new Player
            {
                FirstName   = "Nurettin",
                LastName    = "Ayıpettin",
                NationalId  = 85941736744,
                YearOfBirth = 1881,
                Nickname    = "CokPisOynarım_5334"
            };
            Game game = new Game {
                NameOfGame = "Call of Duty", Price = 1000
            };

            SpecialOffer specialOffer = new SpecialOffer {
                NameOfOffer = "Super Discount", DiscountPercent = 20
            };

            PlayerAccountManager playerAccountManager = new PlayerAccountManager(new PlayerCheckManager());

            playerAccountManager.SignUp(player);
            Console.WriteLine("----");

            SalesManager salesManager = new SalesManager();

            salesManager.SellGame(player, game);
            Console.WriteLine("----");


            SpecialOfferManager specialOfferManager = new SpecialOfferManager();

            specialOfferManager.AddOffer(specialOffer, game);
            Console.WriteLine("----");
            salesManager.DiscountSale(specialOffer, game);
        }
Пример #2
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new NewEStateUserValidationSystem());

            gamerManager.Add(new Gamer
            {
                Id             = 1,
                UserName       = "******",
                FirstName      = "Ahmet",
                LastName       = "Yoldaş",
                BirthYear      = "1999",
                IdentityNumber = 0123456,
                Password       = "******",
            });
            gamerManager.Add(new Gamer
            {
                Id             = 2,
                UserName       = "******",
                FirstName      = "RUMEYSA ",
                LastName       = "ÖZDEMİR",
                BirthYear      = "1994",
                IdentityNumber = 12345,
                Password       = "******"
            });;


            Game game1 = new Game()
            {
                Id = 1, Name = "Hitman 2", Price = 79.90
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "Assassin's Creed 2 Brotherhood", Price = 54.90
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);
            gameManager.Add(game2);

            SpecialOffer specialOffer1 = new SpecialOffer()
            {
                Id = 1, Name = "Büyük Cuma Kampanyası", DiscountRate = 15
            };
            SpecialOffer specialOffer2 = new SpecialOffer()
            {
                Id = 2, Name = "Dev Teknoloji Kampanyası", DiscountRate = 20
            };

            SpecialOfferManager specialOfferManager = new SpecialOfferManager();

            specialOfferManager.Add(specialOffer1);
            specialOfferManager.Add(specialOffer2);

            Gamer gamer1 = new Gamer()
            {
                Id             = 1,
                IdentityNumber = 0123456,
                FirstName      = "Ahmet",
                LastName       = "Yoldaş",
                BirthYear      = "1999",
                UserName       = "******",
                Password       = "******"
            };

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer1, game1);
            saleManager.DiscountedSale(gamer1, game2, specialOffer2);
        }