コード例 #1
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);
        }
コード例 #2
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);
        }