コード例 #1
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, GameName = "Call of Duty", GamePrice = 100.00
            };
            Game game2 = new Game()
            {
                Id = 2, GameName = "Battlefield", GamePrice = 80.00
            };
            Game game3 = new Game()
            {
                Id = 3, GameName = "Medal of Honor", GamePrice = 50.00
            };

            GameManager gameManager = new GameManager();

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

            Console.WriteLine("--------------------------------------------------------------------------------");

            Gamer gamer1 = new Gamer()
            {
                NationalityId = "1212211212121", Name = "Haktan", Surname = "Başak", DateOfBirth = new DateTime(1996, 12, 1)
            };
            Gamer gamer2 = new Gamer()
            {
                NationalityId = "4212214322121", Name = "Mustafa", Surname = "Özdoğan", DateOfBirth = new DateTime(1997, 12, 1)
            };

            GamerManager gamerManager = new GamerManager(new AuthenticationManager());

            gamerManager.Add(gamer1);
            GamerManager gamerManager1 = new GamerManager(new MernisAdapter());

            gamerManager1.Add(gamer2);

            Console.WriteLine("--------------------------------------------------------------------------------");

            Campaign campaign = new Campaign
            {
                Id               = 1,
                CampaignName     = "Büyük Bahar",
                CampaignDiscount = 30
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            Console.WriteLine();
            Console.WriteLine("------------------------- S A T I Ş ----------------------------");
            Console.WriteLine();

            SalesManager salesManager = new SalesManager();

            salesManager.SalesGame(gamer1, game1, campaign);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();
            gamer1.Id = 1;
            gamer1.FirstName = "Büşra";
            gamer1.LastName = "Erpay";
            gamer1.TcNo = 12345;
            gamer1.Birthday = 1998;

            //Game customer2 = new Game();
            //customer2.Id = 1;
            //customer2.FirstName = "Hilal";
            //customer2.LastName = "Baş";
            //customer2.TcNo = "13555743266";
            //customer2.Birthday = "09.11.1995";

            Game game = new Game();
            game.GameId = 1;
            game.GameName = "Pubg";
            game.GameType = "Battle";
            game.GameYear = "2018";
            game.GamePrice = 75.5;

            Campaign campaign = new Campaign();
            campaign.CampaignName = "Student";
            campaign.CampaignId = 1;
            campaign.CampaignDiscount = 0.5;

            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            gamerManager.Add(gamer1);
            gamerManager.Update(gamer1);
            gamerManager.Listele();


            GameManager gameManager = new GameManager();
            gameManager.Add(game);
            gameManager.Update(game);
            gameManager.Listele();


            CampaignManager campaignManager = new CampaignManager();
            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Listele();
            campaignManager.Discount(campaign,game);





           

          

        }
コード例 #3
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer        oyuncu       = new Gamer()
            {
                FirstName   = "Gökhan",
                TcId        = "15453713426",
                DateOfBirth = new DateTime(1999, 02, 18),
                LastName    = "Güney",
                Id          = 1
            };

            gamerManager.Add(oyuncu);
            gamerManager.Remove(oyuncu);
            gamerManager.Update(oyuncu);

            Game oyun = new Game()
            {
                Id = 1, Name = "Wild Rift", Description = "Brand new mobile vers" +
                                                          "ion of League of Legends, you can enjoy the rift on your cellular with this one.", Price = 100
            };
            GameManager gameManager = new GameManager();

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

            Campaign kampanya = new Campaign()
            {
                Id = 1, Discount = 70, Name = "Daft Punk Discount"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(kampanya);
            campaignManager.Edit(kampanya);
            campaignManager.Delete(kampanya);

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(oyuncu, oyun);
            salesManager.SellWithDiscount(oyuncu, oyun, kampanya);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            gamerManager.Add(new Gamer
            {
                BirthDate         = new DateTime(1989, 7, 31),
                Name              = "a",
                LastName          = "b",
                NationalityNumber = "1234"
            });

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                Id       = 2,
                Name     = "İndirim",
                Discount = 10
            });

            GameManager gameManager = new GameManager();

            gameManager.Add(new Game
            {
                Id    = 1,
                Name  = "a",
                Price = 15
            });

            SaleManager salesManager = new SaleManager();

            salesManager.Add(new Gamer {
                Name = "a"
            }, new Game {
                Name = "b"
            }, new Campaign {
                Name = "İndirim"
            });
        }