示例#1
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id        = 1,
                FirstName = "Tulin",
                LastName  = "Aktas",
                Tc        = "000000",
                BirthDate = new DateTime(1998, 09, 18)
            };
            Game game1 = new Game()
            {
                GameId   = 1,
                GameName = "Phasmophobia",
                Price    = 30
            };
            Game game2 = new Game()
            {
                GameId   = 2,
                GameName = "Counter Strike",
                Price    = 120
            };
            Game game3 = new Game()
            {
                GameId   = 3,
                GameName = "Detroit",
                Price    = 220
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId     = 1,
                CampaignName   = "Yeni Uyelik Kampanyasi",
                CampaignAmount = 30
            };

            Campaign campaign2 = new Campaign()
            {
                CampaignId     = 2,
                CampaignName   = "Oyun Haftasi Kampanyasi",
                CampaignAmount = 20
            };

            ICheckService govermentCheck = new GovermentCheckManager();

            GamerManager    gamerManager    = new GamerManager(govermentCheck);
            CampaignManager campaignManager = new CampaignManager();
            SaleManager     saleManager     = new SaleManager();


            campaignManager.Add(campaign1);
            gamerManager.GamerAdd(gamer1);

            saleManager.Sale(game1, gamer1);
            saleManager.CampaignSale(game2, campaign1, gamer1);
            saleManager.CampaignSale(game3, campaign2, gamer1);
        }
示例#2
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

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

            gamerManager.Add(new Gamer {
                Id             = 1,
                BirthYear      = 1985,
                FirstName      = "ENGİN",
                LastName       = "DEMİROĞ",
                IdentityNumber = 12345
            });

            Game game = new Game()
            {
                Id = 1, GameName = "Counter", Price = 10
            };
            Campaign campaign = new Campaign()
            {
                Id = 1, CampaignName = "Kampanya1", CampaignPrice = 8
            };

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer, game);
            saleManager.CampaignSale(gamer, game, campaign);
        }
示例#3
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();

            gamer1.IdNumber  = "12345678910";
            gamer1.GamerId   = "1";
            gamer1.FirstName = "Ahmet";
            gamer1.LastName  = "Kocadağ";
            gamer1.BirthYear = 1980;
            GamerManager gamerManager = new GamerManager();

            if (gamer1.IdNumber == "12345678910")
            {
                gamerManager.Add(gamer1);
            }
            else
            {
                Console.WriteLine("Bilgileriniz e-devlet bilgileriyle uyuşmuyor.");
            }
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);

            Game game1 = new Game();

            game1.GameName     = "GTA 5";
            game1.CampDiscount = 15;
            SaleManager saleManager = new SaleManager();

            saleManager.CampaignSale(game1);
            saleManager.Sale(game1);
        }
示例#4
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                Id = 1, BirthYear = 1985, FirstName = "Hilmi", LastName = "Turgut", IdentityNumber = 12345
            };
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(gamer);

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

            //gamerManager.Add(new Gamer { Id = 1, BirthYear = 1985, FirstName = "Hilmi", LastName = "Turgut", IdentityNumber = 12345 });

            Campaign campaign = new Campaign()
            {
                Id = 1, CampaignName = "Korona için EVDEKAL indirimi", CampaignDiscount = 50
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);

            Game game = new Game()
            {
                Id        = 1,
                GameName  = "CyperPunk 2077",
                GamePrice = 300,
            };
            SaleManager saleManager = new SaleManager();

            saleManager.CampaignSale(gamer, game, campaign);
        }
示例#5
0
        static void Main(string[] args)
        {
            PlayerManager playerManager = new PlayerManager(new UserValidationManager());
            Player        player        = new Player {
                Id = 1, FirstName = "EMRAH", LastName = "RAMAZAN", BirthYear = 1991, IdentityNumber = 11111111111
            };

            playerManager.Add(player);
            playerManager.Update(player);
            playerManager.Delete(player);

            GameManager gameManager = new GameManager();
            Game        game        = new Game {
                Id = 1, Name = "Call Of Duty", UnitPrice = 500
            };

            gameManager.Add(game);
            gameManager.Update(game);
            gameManager.Delete(game);

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign {
                Id = 1, Name = "Savaş Oyununda İndirim", Discount = 50
            };

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(player, game);

            saleManager.CampaignSale(player, game, campaign);
        }
示例#6
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer        gamer        = new Gamer {
                Id = 1, FirstName = "Esra", LastName = "Özdoğan", BirthYear = new DateTime(1998, 09, 15), IdentityNumber = 12345687890
            };

            gamerManager.Add(gamer);
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            GameManager gameManager = new GameManager();
            Game        game        = new Game {
                Id = 1, Name = "Game Name123", UnitPrice = 120
            };

            gameManager.Add(game);
            gameManager.Update(game);
            gameManager.Delete(game);

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign {
                CampaignId = 1, CampaignName = "Discount on game", CampaignDiscount = 25
            };

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer, game);

            saleManager.CampaignSale(gamer, game, campaign);


            /*GamerManager gamerManager = new GamerManager(new UserValidationManager());
             * gamerManager.Add(new Gamer
             * {
             *  Id = 1,
             *  BirthYear = 1984,
             *  FirstName = "ENGİN",
             *  LastName = "DEMİROĞ",
             *  IdentityNumber = 12345
             * });
             *
             * //Yeni bir e devlet sistemi yapısna geçilirse NewEStateUserValidationManager
             * GamerManager gamerManager1 = new GamerManager(new NewEStateUserValidationManager());
             * gamerManager.Add(new Gamer
             * {
             *  Id = 1,
             *  BirthYear = 1984,
             *  FirstName = "ENGİN",
             *  LastName = "DEMİROĞ",
             *  IdentityNumber = 12345
             *
             * });*/
            Console.WriteLine("Hello World!");
        }
示例#7
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            Gamer gamer = new Gamer();

            // kendi bilgilerinizi girerek deneyebilirsiniz...
            gamer.DateOfBirth = new DateTime(1999, 2, 17);
            gamer.FirstName   = "esra";
            gamer.LastName    = "çetintaş";
            gamer.NationalyId = "11111111111";
            gamer.Mail        = "*****@*****.**";

            gamerManager.Add(gamer);


            Game game = new Game();

            game.GameId    = 123456;
            game.GameName  = "Uzay Oyunu";
            game.GamePrice = 19.99f;

            GameManager gameManager = new GameManager();

            gameManager.Add(game);

            Campaign campaign = new Campaign();

            campaign.CampaignId      = 135790;
            campaign.CampaignName    = "Son fırsatlar";
            campaign.CampaignDiscout = 20;

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);

            campaign.CampaignDiscout = 30;
            campaignManager.Update(campaign);

            SaleManager sale = new SaleManager();

            sale.Sale(gamer, game);
            sale.CampaignSale(gamer, game, campaign);
            Console.ReadKey();
        }
示例#8
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new GamerCheckManager());
            Gamer        gamer1       = new Gamer
            {
                Id             = 1,
                FirstName      = "İREM",
                LastName       = "DİLİK",
                BirthYear      = 2001,
                IdentityNumber = 12345678910
            };

            gamerManager.Add(gamer1);
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);

            GameManager gameManager = new GameManager();
            Game        game1       = new Game
            {
                Name  = "LOL",
                Price = 50
            };

            gameManager.Add(game1);
            gameManager.Update(game1);
            gameManager.Delete(game1);

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign1       = new Campaign
            {
                Name       = "Kış İndirimi",
                Percentage = 25
            };

            campaignManager.Add(campaign1);
            campaignManager.Delete(campaign1);
            campaignManager.Update(campaign1);

            SaleManager saleManager = new SaleManager();

            saleManager.CampaignSale(gamer1, game1, campaign1);
            saleManager.GameSale(gamer1, game1);
        }
示例#9
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer
            {
                Id             = 1,
                BirthYear      = 1981,
                FirstName      = "Derya",
                LastName       = "Üçüncü",
                IdentityNumber = 567432189
            };

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

            gamerManager.Add(gamer1);


            Campaign campaign1 = new Campaign
            {
                Id   = 1,
                Name = "Kampanya1"
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1);

            Game game1 = new Game
            {
                Id    = 1,
                Name  = "Oyun1",
                Price = 30,
                Stock = 50
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);


            ISaleService sale = new SaleManager();

            sale.CampaignSale(campaign1, game1, gamer1);
        }
示例#10
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer {
                Id             = 1,
                BirthYear      = 1998,
                FirstName      = "Samet",
                LastName       = "Vural",
                IdentityNumber = 12345
            };
            Gamer gamer2 = new Gamer
            {
                Id             = 2,
                BirthYear      = 1997,
                FirstName      = "Sezer",
                LastName       = "Bozbıyık",
                IdentityNumber = 12345
            };

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

            gamerManager.Add(gamer1);
            gamerManager.Add(gamer2);
            gamerManager.Add(gamer1);

            Game game1 = new Game {
                GameName = "Counter Strike", GamePrice = 150
            };
            Game game2 = new Game {
                GameName = "Pubg", GamePrice = 250
            };

            Campaign campaign1 = new Campaign {
                CampaignId = 1, CampaignName = "Yaz", CampaignDiscount = 10
            };
            Campaign campaign2 = new Campaign {
                CampaignId = 2, CampaignName = "Kış", CampaignDiscount = 5
            };

            SaleManager saleManager = new SaleManager();

            saleManager.CampaignSale(game1, gamer2, campaign2);
        }
示例#11
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MerniseServiceAdapter());
            Gamer        gamer        = new Gamer()
            {
                Id = 1, FirstName = "Merve Büşra", LastName = "Durmuş", NationalityId = "1111111111111", DateOfBirth = new DateTime(1995, 8, 20)
            };

            gamerManager.Save(gamer);
            gamerManager.Delete(gamer);
            gamerManager.Update(gamer);

            GameManager gameManager = new GameManager();
            Game        game        = new Game()
            {
                Id = 1, GameName = "DOOM", GamePrice = 100, GameDescription = "Doom is a first-person shooter presented with early 3D graphics."
            };

            gameManager.Add(game);
            gameManager.Delete(game);
            gameManager.Update(game);


            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign()
            {
                Id = 1, CampaignName = "Doom campaign 1", CampaignDiscount = 10
            };

            campaignManager.Add(campaign);
            campaignManager.Delete(campaign);
            campaignManager.Update(campaign);

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer, game);
            saleManager.CampaignSale(game, gamer, campaign);
        }
示例#12
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id = 1, FirstName = "Ali", LastName = "Yılmaz", NationalityId = "123213553", DateOfBirth = new DateTime(2005, 12, 1)
            };
            Gamer gamer2 = new Gamer()
            {
                Id = 2, FirstName = "Yeşim", LastName = "Sanar", NationalityId = "456897654", DateOfBirth = new DateTime(2004, 5, 6)
            };
            GamerManager gamerManager = new GamerManager();

            gamerManager.Save(gamer1);

            Game game1 = new Game()
            {
                Id = 1, Name = "Grand Theft Auto:San Andreas", Price = 19.75
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "Undertale", Price = 28.75
            };
            SaleManager sale = new SaleManager();

            sale.Sale(gamer2, game1);

            Campaign campaign1 = new Campaign()
            {
                Id = 1, Name = "New Year Campaign", StartingDate = new DateTime(2020, 12, 24), EndDate = new DateTime(2021, 1, 2)
            };
            Campaign campaign2 = new Campaign()
            {
                Id = 2, Name = "Valentine's Day", StartingDate = new DateTime(2021, 2, 7), EndDate = new DateTime(2021, 2, 17)
            };
            SaleManager sale2 = new SaleManager();

            sale2.CampaignSale(campaign1, game2, gamer1);
        }
示例#13
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            Gamer gamer = new Gamer   //gamer information
            {
                Id            = 1,
                FirstName     = "Şeyma Nur",
                LastName      = "Terzioğlu",
                NationalityId = "12345",
                BirthYear     = 1998
            };

            gamerManager.Add(gamer);      //GamerManager's method used
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            Game game = new Game    //game information
            {
                GameId    = 1,
                GameName  = "Attack on Titan / A.O.T. Wings of Freedom",
                GamePrice = "170TL"
            };

            Campaign campaign = new Campaign    //campaign information
            {
                CampaignId       = 1,
                CampaignName     = "8 Mart Kadınlar Günü Kampanyası",
                CampaignDiscount = "%40"
            };

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer, game);                  //SaleManager 's method used
            saleManager.CampaignSale(gamer, game, campaign);
        }
示例#14
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);
                }
            }
        }