Пример #1
0
        static void Main(string[] args)
        {
            GameManager gameManager = new GameManager();

            gameManager.Add(new Game
            {
                Id        = 1,
                Name      = "Valorant",
                UnitPrice = 150
            });

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

            gamerManager.Add(new Gamer
            {
                Id            = 1,
                FirstName     = "Ömer",
                LastName      = "Adıgüzel",
                BirthYear     = 2001,
                NationalityId = 54325728590
            });

            OrderManager orderManager = new OrderManager();

            orderManager.Sale(new Order
            {
                Id        = 1,
                GameName  = "Valorant",
                GamerName = "Ömer"
            });

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                Id           = 1,
                OrderId      = 1,
                CampaignName = "İlk Alım Kampanyası, %25 İndirim Uygulandı!"
            });

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

            gamer.Id          = 1;
            gamer.DateOfBirth = 1999;
            gamer.Name        = "Ahmet";
            gamer.Surname     = "Akbas";
            gamer.TcNo        = "1234567890";

            GamerManager gamerManager = new GamerManager(new NewStateUserValidationManager());

            gamerManager.Add(gamer);

            Campaign campaign = new Campaign();

            campaign.Id   = 1;
            campaign.Name = "Sims 4";
            campaign.Type = "Small Campaign";

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);

            Gamee game = new Gamee();

            game.Id       = 1;
            game.Price    = "€12";
            game.Category = "Fight";
            game.Title    = "Mortal Combat";

            SaleManager saleManager = new SaleManager();

            saleManager.SellGameWithCampaign(gamer, game, campaign);
            saleManager.SellGameWithoutCampaign(gamer, game);

            Console.WriteLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Customer customer = new Customer
            {
                Id            = 1,
                FirstName     = "semih",
                LastName      = "kökçü",
                DateOfBirth   = new System.DateTime(2000, 11, 23),
                NationalityId = "12345678910"
            };

            Games game = new Games
            {
                Id       = 1,
                GameName = "CALL OF DUTY MODERN WARFARE 4",
                Price    = 20
            };

            Campaign campaign = new Campaign
            {
                CampaignName         = "new customer campaigne",
                CampaignDiscountRate = 20
            };

            BaseCustomerManager customerManager = new BaseCustomerManager();
            CampaignManager     campaignManager = new CampaignManager();
            GameManager         gameManager     = new GameManager();

            customerManager.Add(customer);
            campaignManager.Add(campaign);
            gameManager.Sell(game, customer);
            gameManager.SellWithDiscount(game, customer, campaign);



            System.Console.WriteLine(customer + "\n" + campaign);
        }
Пример #4
0
        static void Main(string[] args)
        {
            IPlayer player = new Player {
                PlayerId      = 1,
                PlayerName    = "Abdulkadir",
                PlayerSurname = "KG",
                PlayerTC      = "1234567890"
            };
            IPlayer player2 = new Player
            {
                PlayerId      = 2,
                PlayerName    = "Jeam",
                PlayerSurname = "Carrey",
                PlayerTC      = "1234567892"
            };
            IPlayer player3 = new Player
            {
                PlayerId      = 3,
                PlayerName    = "Durali",
                PlayerSurname = "Durmuş",
                PlayerTC      = "2234567892"
            };

            List <ICheckService> checkServices = new List <ICheckService> {
                //new EDevletCheckAdapter() { },
                new OwnCheckManager()
                {
                }
            };
            PlayerManager playerManager = new PlayerManager(checkServices);

            Console.WriteLine("--------------ADD---------------\n");

            playerManager.Add(player);
            playerManager.Add(player2);
            playerManager.Add(player3);

            Console.WriteLine("\n------BEFORE UPDATE GET ALL-----\n");

            List <IPlayer> list;;

            list = playerManager.GetAll();
            for (int i = 0; i < list.Count; i++)
            {
                Console.WriteLine(list[i].PlayerName + " IS IN LIST");
            }

            Console.WriteLine("\n-------------UPDATE-------------\n");

            IPlayer newData = new Player {
                PlayerId      = 2,
                PlayerName    = "Jim",
                PlayerSurname = "Carrey",
                PlayerTC      = "1234567892"
            };

            playerManager.Update(ref player2, newData);

            Console.WriteLine("\n------AFTER UPDATE GET ALL------\n");

            list = playerManager.GetAll();
            for (int i = 0; i < list.Count; i++)
            {
                Console.WriteLine(list[i].PlayerName + " IS IN LIST");
            }

            Console.WriteLine("\n-------------DELETE-------------\n");

            playerManager.Delete(player2);

            Console.WriteLine("\n------AFTER DELETE GET ALL------\n");

            list = playerManager.GetAll();
            for (int i = 0; i < list.Count; i++)
            {
                Console.WriteLine(list[i].PlayerName + " IS IN LIST");
            }

            Console.WriteLine("\n------------GAME SALE-----------\n");

            Entities.Game game = new Entities.Game();
            game.GameId    = 1;
            game.GameName  = "Counter Strike";
            game.GamePrice = 25.00;


            SaleManager saleManager = new SaleManager();

            saleManager.Sale(game, player);

            Console.WriteLine("\n------------CAMPAIGN------------\n");
            Campaign campaign = new Campaign {
                CampaignId           = 1,
                CampaignName         = "Bayram İndirimi",
                CampaignDiscountRate = 10,
                CampaignInfo         = "Kurban bayramına özel oyunlarda %10 indirim"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            Console.WriteLine("\n------SALE DISCOUNTED GAME------\n");
            saleManager.Sale(game, player2, campaign);
        }
Пример #5
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

            gamer.NationalityId   = "111";
            gamer.FirstName       = "Semanur";
            gamer.LastName        = "Gürsoy";
            gamer.DateOfBirthYear = 2000;
            gamer.UserName        = "******";
            gamer.Email           = "*****@*****.**";
            gamer.Password        = "******";

            Gamer gamer2 = new Gamer();

            gamer2.NationalityId   = "4356546";
            gamer2.FirstName       = "Frodo";
            gamer2.LastName        = "Baggins";
            gamer2.DateOfBirthYear = 2968;
            gamer2.UserName        = "******";
            gamer2.Email           = "*****@*****.**";
            gamer2.Password        = "******";

            Gamer gamer3 = new Gamer();

            gamer3.NationalityId   = "56456";
            gamer3.FirstName       = "Legolas";
            gamer3.LastName        = "SonOfThranduil";
            gamer3.DateOfBirthYear = 0;
            gamer3.UserName        = "******";
            gamer3.Email           = "*****@*****.**";
            gamer3.Password        = "******";

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

            gamerManager.Register(gamer);
            gamerManager.NormalRegister(gamer2);
            gamerManager.NormalRegister(gamer2);
            gamerManager.UpdateUserName(gamer, "Nur");
            gamerManager.Delete(gamer);


            SalesManager salesManager = new SalesManager();

            GameInfo game = new GameInfo();

            game.Name          = "Shadow of Mordor";
            game.Language      = "Türkçe";
            game.Version       = 5;
            game.OriginalPrice = 150;
            game.Price         = 150;

            GameInfo game2 = new GameInfo();

            game2.Name          = "Ring";
            game2.Language      = "Türkçe";
            game2.Version       = 2;
            game2.OriginalPrice = 135;
            game2.Price         = 135;

            salesManager.SellTheGame(game, gamer);
            salesManager.SellTheGame(game, gamer2);
            salesManager.SellTheGame(game, gamer3);
            salesManager.list(game);

            salesManager.SellTheGame(game2, gamer2);
            salesManager.list(game2);

            Campaign campaign = new Campaign();

            campaign.Name    = "Yılbaşı İndirimi";
            campaign.percent = 30;

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign, game2);
            campaignManager.Update(campaign, 30, game2);
            salesManager.SellTheGame(game2, gamer3);
            campaignManager.Delete(campaign, game2);

            salesManager.list(game2);
        }
Пример #6
0
 public void Campaign(CampaignManager campaignManager)
 {
     campaignManager.Add();
 }