Beispiel #1
0
        static void Main(string[] args)
        {
            IUserService     userService     = new UserManager();
            ICampaignService campaignService = new CampaignManager();
            ISalesService    salesService    = new SalesManager();

            User person1 = new User()
            {
                Id = 1, Name = "Volkan", Surname = "Karaali", NationaltyNo = "1234567890", BirthOfDate = "1997"
            };
            Campaign campaign1 = new Campaign()
            {
                Id = 1, Name = "Yaz İndirimi", CampaignPrice = 50
            };
            Game game1 = new Game()
            {
                Id = 1, Name = "CSGO", GamePrice = 20
            };



            campaignService.Add(campaign1);
            campaignService.Delete(campaign1);
            campaignService.Upgrade(campaign1);
            Console.WriteLine("");
            salesService.Display(person1, campaign1, game1);
            Console.WriteLine("");
            userService.Add(person1);
            userService.Delete(person1);
            userService.Upgrade(person1);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            Gamer        gamer        = new Gamer {
                Id = 1, BirthYear = 1986, FirstName = "İLHAN", LastName = "COŞKUN", TcNo = 12345678901
            };

            gamerManager.Add(gamer);

            Console.WriteLine("************************");
            Campaign campaign = new Campaign();

            campaign.CampaignId   = 1;
            campaign.CampaignName = "İlk 10000 kişi";
            campaign.CampaignRate = 50;

            Campaign campaign2 = new Campaign();

            campaign2.CampaignId   = 2;
            campaign2.CampaignName = "Yeni Yıl İndirimi";
            campaign2.CampaignRate = 30;



            Console.WriteLine("************************");

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);

            CampaignManager campaignManager2 = new CampaignManager();

            campaignManager.Add(campaign2);
            campaignManager.Update(campaign2);

            Console.WriteLine("************************");
            Games game = new Games {
                GameId = 1, GameName = "FIFA21", GamePrice = 450
            };
            Games game2 = new Games {
                GameId = 1, GameName = "Call of Duty", GamePrice = 399
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game);

            GameManager gameManager2 = new GameManager();

            gameManager2.Add(game2);

            Console.WriteLine("************************");

            SalesManager salesManager = new SalesManager();

            salesManager.Buy(game, gamer);

            salesManager.BuyWithCampaign(game2, gamer, campaign2);
        }