Esempio n. 1
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);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            User user1 = new User()
            {
                UserId = 1, UserFirstName = "Olcay", UserLastName = "Güneş", UserBirthYear = 1992, UserTcNo = "1234567890"
            };
            User user2 = new User()
            {
                UserId = 2, UserFirstName = "Engin", UserLastName = "Demiroğ", UserBirthYear = 1988, UserTcNo = "9876543210"
            };
            User user3 = new User()
            {
                UserId = 3, UserFirstName = "Ali", UserLastName = "Yılmaz", UserBirthYear = 2000, UserTcNo = "6543219870"
            };

            Game game1 = new Game()
            {
                GameId = 1, GameName = "Football Manager 2021", GamePrice = 150
            };
            Game game2 = new Game()
            {
                GameId = 2, GameName = "PES 2021", GamePrice = 200
            };
            Game game3 = new Game()
            {
                GameId = 3, GameName = "FIFA 2021", GamePrice = 250
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 1, CampaignName = "Black Friday", CampaignDiscount = 50
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Yeni Yıl İndirimi", CampaignDiscount = 40
            };

            Sale sale1 = new Sale()
            {
                SaleId = 1, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "Football Manager 2021", CampaignName = "Black Friday", TotalPrice = (game1.GamePrice) * 0.5
            };
            Sale sale2 = new Sale()
            {
                SaleId = 2, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "PES 2021", CampaignName = "Yeni Yıl İndirimi", TotalPrice = (game2.GamePrice) * 0.6
            };
            Sale sale3 = new Sale()
            {
                SaleId = 3, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "FIFA 2021", CampaignName = "Black Friday", TotalPrice = (game1.GamePrice) * 0.5
            };

            UserValidationManager userValidationManager = new UserValidationManager();
            UserManager           userManager           = new UserManager(userValidationManager);
            GameManager           gameManager           = new GameManager();
            CampaignManager       campaignManager       = new CampaignManager();
            SaleManager           saleManager           = new SaleManager();

            campaignManager.Add(campaign1);
            campaignManager.Add(campaign2);

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

            userManager.Add(user1);
            userManager.Add(user2);
            userManager.Add(user3);

            saleManager.Sale(sale1);
            saleManager.Sale(sale2);
            saleManager.Sale(sale3);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer
            {
                TC        = "1234567890",
                FirstName = "BARIŞ",
                LastName  = "ASLAN",
                BirthYear = "2000"
            };

            Game game1 = new Game
            {
                GameName  = "Red Dead Redemption 2",
                GamePrice = 300
            };
            Game game2 = new Game
            {
                GameName  = "CyberPunk 2077",
                GamePrice = 200
            };
            Game game3 = new Game
            {
                GameName  = "The Last Of Us Part2",
                GamePrice = 150
            };

            Campaign campaign70 = new Campaign
            {
                CampaignId      = 1,
                CampaignName    = "200TL Üzeri 70TL Kupon",
                CampaignEndDate = "02.03.2021"
            };

            Sale sale = new Sale
            {
                Gamer     = gamer.FirstName + gamer.LastName,
                GameName  = game3.GameName,
                GamePrice = game3.GamePrice
            };



            UserValidationManager userValidationManager = new UserValidationManager();
            GamerManager          gamerManager          = new GamerManager(userValidationManager);

            gamerManager.Add(gamer);
            if (userValidationManager.Validate(gamer) == true)
            {
                Console.WriteLine("");

                Console.WriteLine("OYUNLAR");
                GameManager gameManager = new GameManager();
                gameManager.Add(game1);
                gameManager.Add(game2);
                gameManager.Add(game3);

                Console.WriteLine("");

                Console.WriteLine("KAMPANYALAR");
                CampaignManager campaignManager = new CampaignManager();
                campaignManager.Add(campaign70);

                Console.WriteLine("");

                Console.WriteLine("SON İŞLEMLER");
                SaleManager saleManager = new SaleManager();
                if (sale.GamePrice >= 200)
                {
                    saleManager.CampaignSale(gamer, sale, campaign70);
                }
                else
                {
                    saleManager.Sale(gamer, sale);
                }
            }
        }