コード例 #1
0
ファイル: Program.cs プロジェクト: tarikoksuz/GameProject
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            Gamer        gamer1       = new Gamer();

            gamer1.GamerId        = 1;
            gamer1.FirstName      = "Fernando";
            gamer1.LastName       = "Muslera";
            gamer1.IdentityNumber = 123456789;
            gamer1.BirthYear      = 1986;

            Gamer gamer2 = new Gamer();

            gamer2.GamerId        = 2;
            gamer2.FirstName      = "Henry";
            gamer2.LastName       = "Onyekuru";
            gamer2.IdentityNumber = 987654321;
            gamer2.BirthYear      = 1997;



            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign();

            campaign.CampaignId   = 1;
            campaign.CampaignName = "Süper Lig İndirimi";
            campaign.DiscountRate = 0.50;



            GameManager gameManager = new GameManager();
            Game        game1       = new Game();

            game1.GameId    = 1;
            game1.GameName  = "FIFA 2021";
            game1.GamePrice = 250;
            game1.Stock     = 500;

            Game game2 = new Game();

            game2.GameId    = 2;
            game2.GameName  = "PES 2021";
            game2.GamePrice = 200;
            game2.Stock     = 400;



            SaleManager saleManager = new SaleManager();



            gamerManager.Add(gamer1);
            gameManager.Add(game1);
            campaignManager.Add(campaign);
            saleManager.Sales(gamer1, game1, campaign);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            GamerManager gamerManager1 = new GamerManager(new UserValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                Id = 1, BirthYear = 1992, FirstName = "Azize ", LastName = "Aydoğdu", IdentityNumber = 11111
            };
            GamerManager gamerManager2 = new GamerManager(new UserValidationManager());
            Gamer        gamer2        = new Gamer()
            {
                Id = 2, BirthYear = 2020, FirstName = "Ece ", LastName = "Aydoğdu", IdentityNumber = 22222
            };

            Game game1 = new Game()
            {
                Id = 2, GameName = "PUBG", GamePrice = 650
            };
            Game game2 = new Game()
            {
                Id = 3, GameName = "FORTNİTE", GamePrice = 450
            };
            Game game3 = new Game()
            {
                Id = 4, GameName = "GTA 5", GamePrice = 550
            };


            Campaign campaign1 = new Campaign()
            {
                CampaignName = "YENİ ÜYE KAMPANYASI", CampaignEndDate = 052021, CampaignId = 1
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignName = "COVİD-19 KAMPANYASI", CampaignEndDate = 012021, CampaignId = 2
            };


            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager salesManager = new SaleManager();

            salesManager.Sales(game3, gamer2);
            salesManager.CampaignSales(game2, gamer1, campaign2);
        }