示例#1
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();

            gamer1.CustomerName    = "Melihcan";
            gamer1.CustomerSurname = "Serbest";
            gamer1.TcNo            = "12345678910";
            gamer1.DateOfBirth     = "1999";

            Gamer gamer2 = new Gamer();

            gamer2.CustomerName    = "Sena";
            gamer2.CustomerSurname = "Gedik";
            gamer2.TcNo            = "01987654321";
            gamer2.DateOfBirth     = "2000";

            Gamer gamer3 = new Gamer();

            gamer3.CustomerName    = "İrem Sultan";
            gamer3.CustomerSurname = "Kızıl";
            gamer3.TcNo            = "54321678908";
            gamer3.DateOfBirth     = "1999";

            GamerManager customerManager = new GamerManager();

            customerManager.SignUp(gamer1);
            customerManager.Update(gamer2);
            customerManager.Delete(gamer3);

            IGameSaleService summerHoliday     = new SummerHoliday();
            IGameSaleService christmasCampaign = new ChristmasCampaign();

            List <IGameSaleService> sales = new List <IGameSaleService>()
            {
                summerHoliday, christmasCampaign
            };

            Console.ReadLine();
        }
示例#2
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);
        }