Esempio n. 1
0
        static void Main(string[] args)
        {
            Game game1 = new Game();

            game1.GameName  = "CsGo";
            game1.GamePrice = 100;
            Campaign campaign1 = new Campaign();

            campaign1.CampaignName         = "Yeni Üye Kampanyası";
            campaign1.CampaingDiscountRate = 10;
            CampaignManager campaingManager = new CampaignManager();

            campaingManager.Add(campaign1);

            CustomerManager customerManager = new CustomerManager();
            GameManager     gameManager     = new GameManager();

            gameManager.Add(game1);
            Customer customer1 = new Customer();

            customer1.CustomerTc          = 123456;
            customer1.customerName        = "Mehmet";
            customer1.CustomerSurname     = "Topal";
            customer1.CustomerDateofBirth = 1995;
            customerManager.PersonVerification(customer1);
            customerManager.Add(customer1, campaign1);
            gameManager.GameBuy(customer1, campaign1, game1);
            campaign1.CampaingDiscountRate = 15;
            campaingManager.Update(campaign1);
            campaingManager.Delete(campaign1);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //farklı doğrulama altternatifleriyle kullanılabilir
            GamerManager gamerManager  = new GamerManager(new GamerValidationManager());
            GamerManager gamerManager2 = new GamerManager(new NewEStateGamerValidationManager());

            Gamer gamer = new Gamer()
            {
                Id            = 1,
                FirstName     = "Şerife",
                LastName      = "Yaman",
                BirthYear     = 1995,
                NationalityId = "12345"
            };

            gamerManager.Add(gamer);     //oyuncu ekleme

            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "Steam İndirimleri"
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);    //kampanya ekleme
            campaignManager.Update(campaign); //kampanya silme
            campaignManager.Delete(campaign); //kampanya güncelleme

            OrderManager orderManager = new OrderManager(new Campaign1TypeManager());

            orderManager.SatısYap(gamer);    //kampanyaya göre satış yapma
        }
Esempio n. 3
0
        private static void CampaignServiceTest(Campaign campaign)
        {
            ICampaignService campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Delete(campaign);
            campaignManager.Update(campaign);
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            Gamer gamer = new Gamer()
            {
                GamerId       = 1,
                NationalityId = "52753464950",
                FirstName     = "Merve",
                LastName      = "ALKAN",
                DateOfBirth   = new System.DateTime(1998, 6, 7)
            };

            gamerManager.Add(gamer);
            gamerManager.Remove(gamer);
            gamerManager.Update(gamer);

            Game game = new Game()
            {
                GameId          = 2,
                GameName        = "Dota 2",
                GameDescription = "A Modern Multiplayer Masterwork",
                GamePrice       = 150
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game);
            gameManager.Update(game);
            gameManager.Delete(game);

            Campaign campaign = new Campaign()
            {
                CampaignId       = 3,
                CampaignDiscount = 20,
                CampaignName     = "Dota 2 Discount"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(gamer, game);
            salesManager.CampaignSale(gamer, game, campaign);

            Console.ReadLine();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager(new CustomerCheckManager());
            Customer        customer1       = new Customer {
                Id = 1, FirstName = "Yakup", LastName = "Sayın", DateOfBirth = new DateTime(1990, 1, 10)
            };

            customerManager.Add(customer1);
            customerManager.Update(customer1);
            customerManager.Delete(customer1);

            Console.WriteLine();

            GamesManager gameManager = new GamesManager();
            Game         game1       = new Game {
                Name = "Grand Theft Auto V", Studio = "Rockstar Games", Price = 60
            };

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

            Console.WriteLine();

            Campaign campaign1 = new Campaign {
                Name = "PROMO30", Discount = 30
            };
            CampaignManager campaignManager = new CampaignManager();

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

            Console.WriteLine();

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(customer1, game1, campaign1);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                NationalityId = "12345678910",
                FirstName     = "Kadir Uğur",
                LastName      = "Mert",
                DateOfBirth   = new DateTime(1990, 10, 07)
            };

            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                NationalityId = "12345678910",
                FirstName     = "Uğur",
                LastName      = "Mert",
                DateOfBirth   = new DateTime(1990, 10, 07)
            };

            GamerManager gamerManager = new GamerManager(new GamerCheckManager());

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

            Game game1 = new Game()
            {
                Id        = 1,
                GameName  = "Cyberpunk 2077",
                GamePrice = 249
            };

            Game game2 = new Game()
            {
                Id        = 2,
                GameName  = "Microsoft Flight Simulator",
                GamePrice = 349
            };

            GameManager gameManager = new GameManager();

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

            Campaign campaign = new Campaign
            {
                Id                = 1,
                CampaignName      = "New Year",
                CampaignStartDate = new DateTime(2021, 01, 01),
                CampaignDuration  = 30,
                Discount          = 21,
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer1, game1);
            saleManager.Sale(gamer1, game2, campaign);
        }