コード例 #1
0
        static void Main(string[] args)
        {
            Gamers gamer = new Gamers()
            {
                GamerId = 1, GamerName = "Nur", GamerSurname = "Hayat", BirthYear = 2000
            };
            Campaign campaign = new Campaign()
            {
                CampaignId = 1, CampaignName = "february campaign ", CampaignDiscount = 50
            };
            Game game = new Game()
            {
                GameName = "VALORANT", GamePrice = 100, GameType = "FPS", GameId = 1
            };

            GamerManager    gamerManager    = new GamerManager(new ValidationManager());
            GameManager     gameManager     = new GameManager();
            CampaignManager campaignManager = new CampaignManager();

            gameManager.Add(game);
            campaignManager.Add(campaign);



            SalesManager salesManager = new SalesManager();

            salesManager.Sales(gamer, game);
            salesManager.CampaignSales(gamer, game, campaign);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gamzedmr/GameProjectOdev
        static void Main(string[] args)
        {
            GamerManager gamerManager1 = new GamerManager(new UserValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                ID = 1, BirthYear = 1998, FirstName = "Gamze", LastName = "DEMİR", IdentityNumber = 12345
            };
            GamerManager gamerManager2 = new GamerManager(new UserValidationManager());
            Gamer        gamer2        = new Gamer()
            {
                ID = 2, BirthYear = 1996, FirstName = "Fatma", LastName = "DEMİR", IdentityNumber = 67890
            };

            Game game1 = new Game()
            {
                GameID = 1, Name = "PUBG", Price = 250
            };
            Game game2 = new Game()
            {
                GameID = 2, Name = "GTA ", Price = 200
            };
            Game game3 = new Game()
            {
                GameID = 3, Name = "CS-GO", Price = 150
            };


            Campaign campaign1 = new Campaign()
            {
                CampaignID = 1, Name = "Yeni Üyelere Özel Kampanya", Discount = 25,
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignID = 2, Name = "Tatil Kampanyası", Discount = 30,
            };


            CampaignManager campaignManager = new CampaignManager();

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


            SalesManager salesManager = new SalesManager();

            salesManager.Sales(game1, gamer2);
            salesManager.CampaignSales(game1, gamer2, campaign2);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            GamerManager gamerManager1 = new GamerManager(new UserValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                FirstName = "Umut", LastName = "Duman", TcNo = "12345", BirthDay = 1999
            };


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


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


            CampaignManager campaignManager = new CampaignManager();

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

            SalesManager salesManager = new SalesManager();

            salesManager.Sales(game3, gamer1);
            salesManager.CampaignSales(game2, gamer1, campaign2);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            //GamerTest();
            //GameTest();
            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            Gamer        gamer        = new Gamer
            {
                GamerId        = 1,
                DateYear       = new DateTime(2001, 08, 10),
                FirstName      = "Şule",
                LastName       = "Gebedek",
                IdentityNumber = 12312312312
            };

            gamerManager.Add(gamer);

            GameManager gameManager = new GameManager();
            Game        game1       = new Game
            {
                GameId    = 1,
                GameName  = "PUBG",
                GamePrice = 90
            };

            gameManager.Update(game1);

            CampaignRateManager campaignRateManager = new CampaignRateManager();
            Campaign            campaign            = new Campaign
            {
                CampaignId   = 1,
                CampaignName = "Avantajlı %30 İndirim",
                DiscountRate = 0.30M
            };

            campaignRateManager.Add(campaign);

            SalesManager salesManager = new SalesManager();

            //İndirimsiz
            salesManager.Sales(gamer, game1);
            //İndirimli
            salesManager.CampaignSales(game1, gamer, campaign);
        }
コード例 #5
0
        static void Main(string[] args)
        {
            GamerManager gamerManager1 = new GamerManager(new GamerValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                GamerId = 1, GamerFirstName = "Delal", GamerLastName = "Karakuş", DateofBirth = 1995, NationalityId = "123456"
            };

            GamerManager gamerManager2 = new GamerManager(new GamerValidationManager());
            Gamer        gamer2        = new Gamer()
            {
                GamerId = 2, GamerFirstName = "Murat", GamerLastName = "Altınok", DateofBirth = 1992, NationalityId = "522481"
            };

            GamerManager gamerManager = new GamerManager(new GamerValidationManager());

            gamerManager.Add(gamer1);
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);
            gamerManager.Add(gamer2);
            gamerManager.Update(gamer2);
            gamerManager.Delete(gamer2);

            Game game1 = new Game()
            {
                GameId = 1, GameName = "Dead by Daylight", GamePrice = 200
            };
            Game game2 = new Game()
            {
                GameId = 2, GameName = "Life is Satrange", GamePrice = 150
            };
            Game game3 = new Game()
            {
                GameId = 3, GameName = "Shadow of War", GamePrice = 300
            };

            GameManager gameManager = new GameManager();

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

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 1, CampaignName = "Yılbaşı Kampanyası", DiscountRate = 25
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Yaz Kampanyası", DiscountRate = 15
            };

            CampaignManager campaignManager = new CampaignManager();

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

            SalesManager salesManager = new SalesManager();

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

            SalesManager salesmanager = new SalesManager();

            salesManager.Sales(game1, gamer1);
            salesManager.Sales(game2, gamer2);
            salesManager.CampaignSales(game3, gamer2, campaign1);
            salesManager.CampaignSales(game2, gamer1, campaign2);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: fatmacafri/GameSimulator
        static void Main(string[] args)
        {
            GamerManager gamerManager  = new GamerManager(new UserValidationManager());
            GamerManager gamerManager1 = new GamerManager(new NewEStateUserValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                Id = 1, IdentityNumber = 12345, FirstName = "FATMA", LastName = "CAFRİ", YearOfBirth = 1996
            };
            Gamer gamer2 = new Gamer()
            {
                Id = 2, IdentityNumber = 54321, FirstName = "ENGİN", LastName = "DEMİROĞ", YearOfBirth = 1985
            };
            Gamer gamer3 = new Gamer()
            {
                Id = 3, IdentityNumber = 98765, FirstName = "FURKAN", LastName = "CAFRİ", YearOfBirth = 2006
            };

            Console.WriteLine("-------------OYUNCULAR------------");
            gamerManager.Add(gamer1);
            gamerManager.Add(gamer3);
            gamerManager.Update(gamer2);
            gamerManager.Delete(gamer2);
            gamerManager1.Add(gamer3);
            Game game1 = new Game()
            {
                Id = 1, GameName = "CS-GO", GamePrice = 100
            };
            Game game2 = new Game()
            {
                Id = 2, GameName = "DOTA-2", GamePrice = 150
            };
            Game game3 = new Game()
            {
                Id = 3, GameName = "FOOTBALL MANAGER", GamePrice = 250
            };

            Console.WriteLine("-------------OYUNLAR------------");
            Console.WriteLine("OYUN ADI : " + game1.GameName + " --> OYUN FİYATI : " + game1.GamePrice);
            Console.WriteLine("OYUN ADI : " + game2.GameName + " --> OYUN FİYATI : " + game2.GamePrice);
            Console.WriteLine("OYUN ADI : " + game3.GameName + " --> OYUN FİYATI : " + game3.GamePrice);

            Campaign campaign1 = new Campaign()
            {
                Id = 1, CampaignName = "HOŞGELDİN KAMPANYASI", DiscountRate = 20
            };
            Campaign campaign2 = new Campaign()
            {
                Id = 2, CampaignName = "SEZON SONU KAMPANYASI", DiscountRate = 50
            };
            Campaign campaign3 = new Campaign()
            {
                Id = 3, CampaignName = "EVDE KAL KAMPANYASI", DiscountRate = 60
            };

            Console.WriteLine("-------------KAMPANYALAR------------");
            CampaignManager campaignManager = new CampaignManager();

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

            Console.WriteLine("-------------SATIŞLAR------------");
            SalesManager salesManager = new SalesManager();

            salesManager.Sales(gamer1, game1);
            salesManager.CampaignSales(gamer2, game3, campaign3);
        }