예제 #1
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                FirstName = "Sinem", LastName = "Algül", BirthYear = 2000, IdentityNumber = 12345678901, UserName = "******", CreditCardNumber = 1111111
            };
            Gamer gamer2 = new Gamer()
            {
                FirstName = "Şimal", LastName = "Baykal", BirthYear = 2000, IdentityNumber = 12345678900, UserName = "******", CreditCardNumber = 1111110
            };
            Gamer gamer3 = new Gamer()
            {
                FirstName = "Serenay", LastName = "Ungör", BirthYear = 2000, IdentityNumber = 12345678911, UserName = "******", CreditCardNumber = 1111100
            };

            Game game1 = new Game()
            {
                Id = 1, Name = "Crusader Kings 3", Price = 70
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "FIFA21", Price = 200
            };
            Game game3 = new Game()
            {
                Id = 3, Name = "Hearts of Iron 4", Price = 50
            };

            Campaign campaign1 = new Campaign()
            {
                Id = 100, CampaignName = "WINTER SALE", Discount = 25
            };
            Campaign campaign2 = new Campaign()
            {
                Id = 200, CampaignName = "SUMMER SALE", Discount = 50
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.CampaignDelete(campaign1);
            campaignManager.CampaignUpdate(campaign2);

            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

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

            SalesManager salesManager = new SalesManager();

            salesManager.Buy(game1, gamer2);
            salesManager.Buy(game2, gamer1);
            salesManager.Buy(game3, gamer3);
        }
예제 #2
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();
        }
예제 #3
0
        public static void Main(string[] args)
        {
            //Doğru bilgiler girilmeden hata verir
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            gamerManager.Add(new Gamer
            {
                DateOfBirth   = new DateTime(1995, 5, 11),
                FirstName     = "Cevat",
                LastName      = "Sarıkaya",
                NationalityId = "12536"
            });

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                Id       = 2,
                Name     = "1 al 2 öde",
                Discount = 10
            });

            ProductManager productManager = new ProductManager();

            productManager.Add(new Product
            {
                Id    = 3,
                Name  = "Mario",
                Price = 15
            });

            SalesManager salesManager = new SalesManager();

            salesManager.Add(new Gamer {
                FirstName = "Cevat"
            }, new Product {
                Name = "Mario"
            }, new Campaign {
                Name = "1 al 2 öde"
            });
        }
예제 #4
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);
        }
예제 #5
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                Id = 1, FirstName = "ENGİN", LastName = "DEMİROĞ", BirthYear = 1985, IdentityNumber = 12345
            });
            Console.WriteLine("Hello World!");

            Game game1 = new Game();

            game1.Id       = 1;
            game1.GameName = "Basketball";
            game1.Price    = 25;

            Game game2 = new Game();

            game2.Id       = 2;
            game2.GameName = "Futball";
            game2.Price    = 13;

            Campaign campaign1 = new Campaign();

            campaign1.CampaignId   = 5;
            campaign1.CampaignName = "Fırsat";
            campaign1.DiscountRate = 15;


            CampaignManager campaignManager1 = new CampaignManager();

            campaignManager1.Add(game2);
            campaignManager1.Delete(game1);

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(game1, campaignManager1, campaign1);
        }