コード例 #1
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                FirstName = "Elif", LastName = "İntizam", NationalityId = "12345678910", YearOfBirth = 1999
            };
            GamerManager gamermanager = new GamerManager(new GamerValidationManager());

            gamermanager.AddGamer(gamer1);

            Game game1 = new Game()
            {
                GameId = 11111, GameName = "Super Mario", GamePrice = 55.89
            };
            GameManager gameManager = new GameManager();

            gameManager.AddGame(game1);

            Campaign campaign1 = new Campaign()
            {
                CampaignName = "New Year Campaign", AmountOfDiscount = 20
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.AddCampaign(campaign1);

            Sales sales1 = new Sales()
            {
                SalesId = "22222", BuyerName = gamer1.FirstName, SaledGame = game1.GameName
            };
            SalesManager salesManager = new SalesManager();

            salesManager.Saled(game1, gamer1, sales1);
            salesManager.SaledWithCampaign(game1, gamer1, sales1, campaign1);
        }
コード例 #2
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);
        }
コード例 #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 NewEStateUserValidationManager());
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                Id = 1, BirthYear = 1992, FirstName = "Aykut", LastName = "Öztürk", IdentityNumber = 12345
            });

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign {
                CampaignName = "4 al 3 öde", CampaignStart = "10.04.2021", CampaignFinish = "10.05.2021"
            };

            SalesManager salesManager = new SalesManager();
            Sales        sales        = new Sales {
                SalesPrice = 300, SalesAmount = 10
            };

            salesManager.Sell(sales, campaign);
        }