Пример #1
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer
            {
                TcNo      = "4532532",
                FirstName = "Burak",
                LastName  = "YILDIZ",
                BirthDate = "2000"
            };

            Game game1 = new Game
            {
                GameName  = "Red Dead Redemption 2",
                GamePrice = 259
            };
            Game game2 = new Game
            {
                GameName  = "CyberPunk 2077",
                GamePrice = 250
            };
            Game game3 = new Game
            {
                GameName  = "Grand Theft Auto V",
                GamePrice = 89
            };

            Campaign campaign60 = new Campaign
            {
                CampaignId      = 1,
                CampaignName    = "150TL Üzeri 60TL Kupon",
                CampaignEndDate = "02.03.2021"
            };

            Sale sale = new Sale
            {
                Gamer     = gamer.FirstName + gamer.LastName,
                GameName  = game3.GameName,
                GamePrice = game3.GamePrice
            };



            UserValidationManager userValidationManager = new UserValidationManager();
            GamerManager          gamerManager          = new GamerManager(userValidationManager);

            gamerManager.Add(gamer);
            if (userValidationManager.Validate(gamer) == true)
            {
                Console.WriteLine("");

                Console.WriteLine("OYUNLAR");
                GameManager gameManager = new GameManager();
                gameManager.Add(game1);
                gameManager.Add(game2);
                gameManager.Add(game3);

                Console.WriteLine("");

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

                Console.WriteLine("");

                Console.WriteLine("SON İŞLEMLER");
                SaleManager saleManager = new SaleManager();
                if (sale.GamePrice >= 200)
                {
                    saleManager.CampaignSale(gamer, sale, campaign60);
                }
                else
                {
                    saleManager.Sale(gamer, sale);
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            // oyunlar
            Game game1 = new Game();

            game1.Id           = 1;
            game1.GameName     = "SEGA PC Football Manager 2021";
            game1.GameCategori = "Spor";
            game1.GamePrice    = 249;
            game1.GameType     = "PC Consol";
            game1.GameEAN      = "5055277040483";

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);
            gameManager.Add(new Game {
                Id = 2, GameName = "ACTIVISION Call Of Duty Siyah OPS 4", GameCategori = "Spor", GamePrice = 299, GameType = "Oyun CD", GameEAN = "5030917257261"
            });


            //Kampanya Ekleme

            Campaign campaign1 = new Campaign();

            campaign1.Id                      = 1;
            campaign1.CampaignName            = "Yılbaşı Kampanyası";
            campaign1.CampaignPercentDiscount = 40;
            campaign1.StartDate               = new DateTime(2020, 12, 15);
            campaign1.EndDate                 = new DateTime(2021, 01, 01);

            Console.WriteLine("\n");

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1);
            campaignManager.Add(new Campaign
            {
                Id                      = 2,
                CampaignName            = "14 Şubat Kampanyası",
                CampaignPercentDiscount = 25,
                StartDate               = new DateTime(2021, 02, 08),
                EndDate                 = new DateTime(2021, 02, 15)
            });


            // oyuncu ekleme
            User gamer1 = new User();

            gamer1.Id              = 1;
            gamer1.FirstName       = "Ezgi";
            gamer1.LastName        = "Mola";
            gamer1.BirthYear       = 1980;
            gamer1.IdentitiyNumber = 45367557888521;

            GamerUserManager gamerManager = new GamerUserManager(new NewEStateUserValidationManager());

            gamerManager.Add(gamer1);
            gamerManager.Add(new User {
                Id = 2, FirstName = "Berkan", LastName = "Karabulut", BirthYear = 1987, IdentitiyNumber = 453675571908307
            });


            // kayıt başarılı ise oyun satın al.
            if (gamerManager.kayitBasariliMi)
            {
                gamerManager.List();

                Console.WriteLine("\n SATILAN OYUNLAR ");
                OrderManager orderManager = new OrderManager();
                orderManager.Order(gamer1, game1, campaign1);
            }


            Console.Read();
        }