Inheritance: GameDemo.CustomerManger
Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IGamerServices gamerServices = new GamerManager(new RealIfPersonManager());

            Gamer gamer = new Gamer();

            gamer.Id            = 1;
            gamer.FirstName     = "çağrı";
            gamer.LastName      = "candan";
            gamer.BirthYear     = new DateTime(2000, 1, 11);
            gamer.NationalityId = "1234";

            gamerServices.Add(gamer);
            gamerServices.Update(gamer);
            gamerServices.Delete(gamer);


            GameSales gameSales = new GameSales();
            Campaign  campaign  = new Campaign();

            campaign.Id           = 1;
            campaign.CampaignName = "bir alana bir bedava";

            gameSales.Id       = 1;
            gameSales.GameName = "pubg";

            ICampaignServices campaignServices = new CampaignManager();
            IGameSales        gameSales1       = new GameSalesManager();

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

            gameSales1.Sale(gameSales, campaign);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                GamerId = 1, GamerFirstName = "Semih", GamerLastName = "Arslan", GamerNationalityId = "11111111111", GamerDateOfBirth = "1900.5.5"
            };

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

            gamerManager.Add(gamer1);

            Game game1 = new Game()
            {
                GameName = "Grand Theft Auto V", GamePrice = 500
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);

            GameOwnerManager gameOwnerManager = new GameOwnerManager();

            gameOwnerManager.OwnGame(game1, gamer1);

            Campaign campaign1 = new Campaign {
                CampaignName = "Student Campaign", CampaignDiscountAmount = 50
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.BuyWithCampaign(game1, campaign1, gamer1);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, Name = "Pubg", Price = 500
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "Call of Duty", Price = 750
            };
            Gamer gamer1 = new Gamer()
            {
                Id = 1, FirstName = "TUFAN", LastName = "ÇEVİK", BirthYear = new DateTime(1993, 04, 18), NationalityId = "54493378456",
                CreditCardNumber = 132465798, UserName = "******"
            };
            Gamer gamer2 = new Gamer()
            {
                Id               = 1,
                FirstName        = "Emin",
                LastName         = "Çölaşan",
                BirthYear        = new DateTime(1991, 11, 05),
                NationalityId    = "54493378456",
                CreditCardNumber = 132465798,
                UserName         = "******"
            };


            Campaign campaign = new Campaign()
            {
                GameId = 3, CampaignName = "Back to Sunny", RateOfDiscount = 15
            };
            CampanyManager campanyManager = new CampanyManager();

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


            CustomerManger customerManger = new GamerManager(new MernisServiceAdapter());

            customerManger.Save(gamer1);
            customerManger.Save(gamer2);
            //customerManger.Delete(gamer1);

            Sales sales1 = new Sales()
            {
                Game = game1.Name, Gamer = gamer1.FirstName
            };
            Sales sales2 = new Sales()
            {
                Game = game2.Name, Gamer = gamer2.FirstName
            };
            SalesManager salesManager = new SalesManager();

            salesManager.Buy(game1, gamer1);
            salesManager.Buy(game2, gamer2);

            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            //GamerManager gamerManager2 = new GamerManager(new NewEStateUserValidationManager());
            gamerManager.Add(new Gamer {
                Id = 1, BirthYear = 1998, FirstName = "YASİN", IdentityNumber = 11111111111
            });
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, Name = "Counter-Strike: Global Offensive", Price = 70
            };

            Game game2 = new Game()
            {
                Id = 2, Name = "Among Us", Price = 57
            };

            Game game3 = new Game()
            {
                Id = 3, Name = "DOTA 2", Price = 45
            };

            Gamer gamer1 = new Gamer()
            {
                Id = 7, BirthYear = 1992, FirstName = "Hakkı", LastName = "Karakaş", Username = "******", NationalityId = "46204222222", CreditCardNumber = 101010101
            };



            //Kullanıcı bilgileri yanlış olduğu için Exceptiona gidecek, doğruları girildiğinde çalışıyor.

            Campaign campaign1 = new Campaign()
            {
                GameId = 352, CampaignName = "Kış Festivali", RateOfDiscount = 13
            };
            Campaign campaign2 = new Campaign()
            {
                GameId = 368, CampaignName = "Sömestır Maratonu", RateOfDiscount = 24
            };
            CampaignManager campaignManager = new CampaignManager();

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


            BaseGamerManager customerManager = new GamerManager(new MernisServiceAdapter());

            customerManager.Save(gamer1);



            Sales sales1 = new Sales()
            {
                Game = game1.Name, Gamer = gamer1.Username
            };

            SalesManagement salesManagement = new SalesManagement();

            salesManagement.Buy(game1, gamer1);
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id         = 1,
                Name       = "Nurullah",
                Surname    = "Sütçü",
                BirthOfDay = "09.12.1994",
                TcNo       = "20843290736",
                NickName   = "Nuro"
            };
            Gamer gamer2 = new Gamer()
            {
                Id         = 2,
                Name       = "Ezgi",
                Surname    = "Polat",
                BirthOfDay = "08.06.1992",
                TcNo       = "16094678906",
                NickName   = "EPolat"
            };

            List <Gamer> gamers = new List <Gamer>()
            {
                gamer1, gamer2
            };
            GamerManager gamerManager = new GamerManager(new NewEstateUserValidationManager());

            gamerManager.Add(gamers);

            Game game1 = new Game()
            {
                Id = 1, Name = "PES20", Platform = "XBOX", Price = 90.6
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "Tetris", Platform = "PS-4", Price = 67.3
            };

            List <Game> games = new List <Game>()
            {
                game1, game2
            };

            Campaign campaign = new Campaign()
            {
                Id = 1, Name = "Black Friday", DiscountRate = 50, CampaignDetails = "Mayıs Sonuna Kadar"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            Sales sales = new Sales();

            sales.Sell(games, gamer1, campaign);
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            GameDb gameDb       = new GameDb();
            var    validation   = new UserValidationManager();
            var    gamerManager = new GamerManager(validation, gameDb);
            Gamer  gamer1       = new Gamer
            {
                Id         = 1,
                UserName   = "******",
                Email      = "salsağ@hotmail.com",
                FirstName  = "Salih",
                LastName   = "Sağsalim",
                IdentityNo = "11111111111",
                DOB        = new DateTime(01 / 01 / 199)
            };
            Gamer gamer2 = new Gamer
            {
                Id         = 1,
                UserName   = "******",
                Email      = "salsağ@hotmail.com",
                FirstName  = "Salih",
                LastName   = "Sağsalim",
                IdentityNo = "11111111111",
                DOB        = new DateTime(01 / 01 / 199)
            };

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

            var      salesManager    = new SalesManager(gameDb);
            var      campaignManager = new CampaignManager(gameDb);
            var      campaignList    = new List <Campaign>();
            Campaign campaign        = new Campaign
            {
                Id       = 1,
                Name     = "No Campaign",
                Discount = 0
            };

            campaignList.Add(campaign);

            Sale sale = new Sale
            {
                Id        = 1,
                GamerId   = 1,
                Gamer     = gamer1,
                SaleDate  = DateTime.Now,
                Campaigns = campaignList
            };

            salesManager.Add(sale);
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer
            {
                Id                   = 1,
                BirthYear            = 1999,
                FirstName            = "MİREM",
                LastName             = "IŞILDAK",
                IdentificationNumber = 987654
            });
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            IGamerValidationService gamerValidationService = new GamerValidationManager();

            gamerValidationService.Validation(new Gamer {
                Id = 1, Name = "Tuncay", Surname = "CAN", TcNo = "55555455455", Birthday = "01.01.1998"
            });

            IGamerServices gamerServices = new GamerManager();

            gamerServices.Add(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });
            gamerServices.Delete(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });
            gamerServices.Update(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });

            IProductService productService = new ProductManager();

            productService.Add(new Product {
                Id = 1, ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            });
            productService.Delete(new Product {
                Id = 1, ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            });
            productService.Update(new Product {
                Id = 1, ProductName = "PES19", UnitPrice = "289TL", UnitStock = "125"
            });

            IOrderService orderService = new OrderManager();

            orderService.Sale(new Order {
                Id = 1, OrderId = 1, OrderNo = "1", ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            },
                              new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });;;

            ICampaignService campaignService = new CampaignManager();

            campaignService.Add(new Campaign {
            });
            campaignService.Delete(new Campaign {
            });
            campaignService.Update(new Campaign {
            });
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new campaign()
            {
                CamGameName = "MTN2", CampaignId = 1, CampaignDiscount = "½20"
            });



            Gamer gamer1 = new Gamer();

            gamer1.Id            = 2;
            gamer1.NationalityId = " 10838990626";
            gamer1.LastName      = "ciritci";
            gamer1.FirstName     = "gizem";
            // gamer1.BirthYear = 1998;


            GamerManager gamerManager = new GamerManager();

            gamerManager.Add(new Gamer {
                BirthYear     = new DateTime(1998, 01, 03),
                FirstName     = "gizem",
                LastName      = "ciritci",
                NationalityId = "10838990626",
                Id            = 2
            });


            Console.WriteLine(gamerManager);

            Game game1 = new Game();

            game1.GameName  = "Grand Theft Auto V";
            game1.GamePrice = 450;

            campaign campaign = new campaign();

            campaign.CamGameName = "black friday";


            GameSellManager gameSellManager = new GameSellManager();

            gameSellManager.Sell(game1, gamer1);
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                BirthYear = 1998,
                FirstName = "BESTE",
                LastName  = "DÜLGER",
                NationalIdentityNumber = 1111111111
            });

            ProductManager productManager = new ProductManager(new ProductCampaignManager());

            productManager.Update(new Product {
                Availibility = true, ProductPrice = 100
            });
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerName      = "Aslıhan",
                GamerBirthDate = "27.07.2001",
                GamerTC        = "11111111111"
            };
            GamerManager gamerManager = new GamerManager();

            EDevletInfo eDevletInfo = new EDevletInfo()
            {
                TC = "11111111111"
            };

            if (eDevletInfo.TC == gamer.GamerTC)
            {
                gamerManager.Add(gamer);
            }
            else
            {
                Console.WriteLine("kullanıcı bulunamadı");
            }
            //gamerManager.Add(gamer);
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "Yeni Yıl İndirimi"
            };
            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.Selling(gamer);
            saleManager.CampaignSelling(campaign, gamer);


            Console.ReadKey();
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerId = 1, GamerName = "Sena", GamerLastname = "yesilyurt", TC = "00000000000", YearOfBirth = 1999
            };

            GamerManager gamerManager = new GamerManager(new ValidationManager());

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

            Console.WriteLine("***************************************************************");

            Game game = new Game()
            {
                GameId = 1, GameName = "xyz", GamePrice = 500
            };

            GameManager gameManager = new GameManager();

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

            Console.WriteLine("***************************************************************");

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(game, gamer);

            Console.WriteLine("***************************************************************");

            Campaign campaign = new Campaign()
            {
                CampaignId = 1, CampaignName = "sana özel", CampaignDiscountAmount = 15
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(game, gamer, campaign);
            campaignManager.Delete(game, gamer, campaign);
            campaignManager.Update(game, gamer, campaign);
        }
Exemplo n.º 14
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                Id = 1, FirstName = "Esma", LastName = "Kızılkaya", NationalityId = "12345678901", BirthYear = 1998
            };
            Games games = new Games()
            {
                Id = 1, Name = "Football Manager 2021", Price = 199.20
            };
            Campaign campaign = new Campaign()
            {
                Id = 1, Name = "%20 İndirim"
            };
            int   numberof = 2;
            Order order    = new Order()
            {
                Id = 1, GamerId = gamer.Id, GameId = games.Id, DateOfOrder = DateTime.Today, NumberOf = numberof, OrderPrice = games.Price * numberof
            };
            GamerManager      gamerManager      = new GamerManager();
            GamesManager      gamesManager      = new GamesManager();
            GamerCheckManager gamerCheckManager = new GamerCheckManager();
            CampaignManager   campaignManager   = new CampaignManager();
            OrderManager      orderManager      = new OrderManager();

            //oyuncu işlemleri
            gamerManager.SignUp(gamer);
            gamerManager.UpdateProfile(gamer);
            gamerManager.DeleteProfile(gamer);

            //oyun işlemleri
            gamesManager.Add(games);
            gamesManager.Delete(games);

            //kampanya işlemleri
            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            //sipariş işlemleri
            orderManager.Order(order);
        }
Exemplo n.º 15
0
        static void Main(string[] args)
        {
            //GamerManager needs a validation service as parameter.
            GamerManager gamerManager = new GamerManager(new AnotherValidationManager());

            gamerManager.Add(new Gamer
            {
                Id      = 1, YearOfBirth = 1994, Name = "ECE",
                Surname = "ÖRÜCÜ", IdentityNumber = 00000
            });

            Console.WriteLine("/////////////Order Test//////////");

            OrderManager orderManager = new OrderManager(new CampaignManager());
            Order        order        = new Order {
                OrderPrice = 50
            };

            orderManager.GetOrder(order);
        }
Exemplo n.º 16
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            Gamer        gamer        = new Gamer()
            {
                Id        = 1,
                FirstName = "AHMET",
                LastName  = "ŞENGÜL",
                DogumYılı = 2000,
                TcNo      = "12587456398"
            };

            gamerManager.Add(gamer);

            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "Ağaya Beleş",
                CampaignRate = 0
            };

            Game game = new Game()
            {
                Id       = 1,
                GameName = "Leistok",
                Price    = 50,
            };

            CampaingManager campaignManager = new CampaingManager();

            campaignManager.Add(campaign);

            GameSellManager gameSellManager = new GameSellManager(campaign, game);

            gameSellManager.sell(game, gamer, campaign);



            Console.ReadLine();
        }
Exemplo n.º 17
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());
            Gamer        gamer        = new Gamer()
            {
                Id             = 1,
                BirthYear      = 1985,
                FirstName      = "ENGİN",
                LastName       = "DEMİROĞ",
                IdentityNumber = 12345
            };

            gamerManager.Add(gamer);


            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "3 Al 1 Öde",
                CampaingRate = 0
            };
            Game game = new Game()
            {
                Id          = 1,
                GameName    = "Counter Strike",
                GamePrice   = 50,
                UnitInStock = 55
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);

            GameSalesManager gameSalesManager = new GameSalesManager(campaign, game);

            gameSalesManager.Sale(game, gamer, null);
        }
Exemplo n.º 18
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, Name = "Counter-Strike: Global Offensive", Price = 70
            };

            Game game2 = new Game()
            {
                Id = 2, Name = "Among Us", Price = 57
            };

            Game game3 = new Game()
            {
                Id = 3, Name = "DOTA 2", Price = 45
            };

            Gamer gamer1 = new Gamer()
            {
                Id = 70, BirthYear = 1996, FirstName = "Ali", LastName = "Kaya", UserName = "******", NationalityId = 25413698705, CreditCardNumber = 365412389
            };

            Gamer gamer2 = new Gamer()
            {
                Id = 77, BirthYear = 1999, FirstName = "Sümeyra", LastName = "Sağır", UserName = "******", NationalityId = 25694262770, CreditCardNumber = 962415386
            };

            Gamer gamer3 = new Gamer()
            {
                Id = 97, BirthYear = 2005, FirstName = "Zeynep Güher", LastName = "Sağır", UserName = "******", NationalityId = 75300438506, CreditCardNumber = 462415386
            };

            //Kullanıcı bilgileri yanlış olduğu için Exceptiona gidecek, doğruları girildiğinde çalışıyor.

            Campaign campaign1 = new Campaign()
            {
                GameId = 352, CampaignName = "Kış Festivali", RateOfDiscount = 13
            };
            Campaign campaign2 = new Campaign()
            {
                GameId = 368, CampaignName = "Sömestır Maratonu", RateOfDiscount = 24
            };
            CampaignManager campaignManager = new CampaignManager();

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


            BaseCustomerManager customerManager = new GamerManager(new MernisServiceAdapter());

            customerManager.Save(gamer3);
            customerManager.Save(gamer1);
            customerManager.Save(gamer2);
            customerManager.Update(gamer2);


            Sales sales1 = new Sales()
            {
                Game = game1.Name, Gamer = gamer3.UserName
            };

            SalesManagement salesManagement = new SalesManagement();

            salesManagement.Buy(game3, gamer3);
            salesManagement.Buy(game1, gamer2);
        }
Exemplo n.º 19
0
 public void Sell(GamerManager gamer, GameManager game)
 {
     Console.WriteLine(game.OyunAdi + " " + "Oyun kütüphanenize eklendi" + " " + gamer.Ad + " " + gamer.Soyad);
 }
Exemplo n.º 20
0
        static void Main(string[] args)
        {
            //Oyuncu Ekleme
            IGamerService      gamerService      = new GamerManager(new GamerCheckManager());
            IGamerCheckService gamerCheckService = new GamerCheckManager();
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                FirstName     = "Melike",
                LastName      = "Işık",
                BirthYear     = 1996,
                NationalityId = "12345678910"
            };
            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                FirstName     = "Müge",
                LastName      = "Işık",
                BirthYear     = 2000,
                NationalityId = "12345678910"
            };

            gamerService.Add(gamer1);
            gamerService.Add(gamer2);


            gamerService.Delete(gamer1);  //Oyuncu Silme
            gamer2.FirstName = "Nimet Müge";
            gamerService.Update(gamer2);

            IGameService gameService = new GameManager();
            Game         game1       = new Game()
            {
                Id          = 1,
                Name        = "Grand Theft Auto 5",
                Price       = 152.10,
                Detail      = "Grand Theft Auto serisinin beşinci oyunudur. Tüm GTAV hikayesi, GTA Online ve mevcut içerik ve yükseltmelerin tümünün yanı sıra GTA Online’da kendi suç imparatorluğunu kurmanın en kısa yolu Criminal Enterprise Başlangıç Paketi de bulunuyor.",
                UnitInStock = 1,
            };

            Game game2 = new Game()
            {
                Id          = 2,
                Name        = "The Sims 4",
                Price       = 265,
                Detail      = "The Sims 4, serinin önceki oyunları gibi yaşam simülasyonu oyunudur. Oyuncular bir Sim karakteri yaratırlar ve oyunda farklı Sim kişiliklerini keşfederek oyuna yön verirler. Simler daha önceki oyunlardan farklı olarak aynı anda iki fiziksel eylemi gerçekleştirebilir. Ayrıca Simlerin modları da oyun akışını değiştirebilir. Örneğin kızgın ya da heyecanlı bir Sim, verilen bir görevi daha hızlı yapar.",
                UnitInStock = 2,
            };

            //Kampanya ekleme

            ICompaignService compaignService = new CompaignManager();
            Compaign         compaign1       = new Compaign()
            {
                Id       = 1,
                Name     = "Black Friday Compaign",
                Discount = 10,
            };

            Compaign compaign2 = new Compaign()
            {
                Id       = 2,
                Name     = "Happy New Year Compaign",
                Discount = 20,
            };

            compaignService.Add(compaign1);
            compaignService.Add(compaign2);

            gameService.ApplyCompaign(compaign1, game1);
            gameService.ApplyCompaign(compaign1, game2);

            gameService.SellGame(game1, gamer2);
            gameService.SellGame(game2, gamer2);
            gameService.SellGame(game1, gamer1);
        }
Exemplo n.º 21
0
 public void Kayıt(GamerManager gamer)
 {
     Console.WriteLine("Oyuncu kayıtı başarılı" + " " + gamer.Id + " " + gamer.Ad + " " + gamer.Soyad + " " + gamer.DogumYili + " " + gamer.TcNo);
 }
Exemplo n.º 22
0
        static void Main(string[] args)
        {
            //Oyuncular
            Gamer gamer1 = new Gamer();

            gamer1.GamerId       = 1;
            gamer1.FirstName     = "merve";
            gamer1.LastName      = "aydın";
            gamer1.NationalityId = "12345";
            gamer1.DateOfBirth   = new DateTime(1992, 10, 10);

            Gamer gamer2 = new Gamer();

            gamer2.GamerId       = 2;
            gamer2.FirstName     = "ferhat";
            gamer2.LastName      = "aydın";
            gamer2.NationalityId = "123456";
            gamer2.DateOfBirth   = new DateTime(1985, 2, 1);

            Gamer gamer3 = new Gamer();

            gamer3.GamerId       = 3;
            gamer3.FirstName     = "esra";
            gamer3.LastName      = "aydın";
            gamer3.NationalityId = "1234567";
            gamer3.DateOfBirth   = new DateTime(1995, 1, 1);


            //Kampanyalar
            Campaign campaign1 = new Campaign();

            campaign1.CampaignId    = 10;
            campaign1.CampaignName  = "kış ";
            campaign1.CampaignValue = "%5";

            Campaign campaign2 = new Campaign();

            campaign2.CampaignId    = 11;
            campaign2.CampaignName  = "tatil  ";
            campaign2.CampaignValue = "%10";

            Campaign campaign3 = new Campaign();

            campaign3.CampaignId    = 12;
            campaign3.CampaignName  = "yaz ";
            campaign3.CampaignValue = "%15";

            //Oyunlar

            Game game1 = new Game();

            game1.GameId    = 5;
            game1.GameName  = "tetris";
            game1.GamePrice = 100.0;

            IGamerService gamerService = new GamerManager(new GamerCheckManager());

            gamerService.Save(gamer1);
            gamerService.Update(gamer2);
            gamerService.Delete(gamer3);

            Console.WriteLine("----------------------------");

            ICampaignService campaignService = new CampaignService();

            campaignService.Add(campaign3);
            campaignService.Delete(campaign2);
            campaignService.Update(campaign1);

            Console.WriteLine("----------------------------");

            IGameSellService gameSellService = new GameManager();

            gameSellService.Sell(gamer2, game1, campaign2);
        }
Exemplo n.º 23
0
        static void Main(string[] args)
        {
            IGamer player1 = new OldGamer()
            {
                TcNo = "1", BirthYear = 1999, GamerName = "Ezgi", GamerSurname = "Akar", MembershipYear = 2
            };
            IGamer player2 = new OldGamer()
            {
                TcNo = "2", BirthYear = 1985, GamerName = "Engin", GamerSurname = "Demiroğ", MembershipYear = 20
            };
            GamerManager playerManager = new GamerManager();

            playerManager.Add(player1);
            playerManager.Add(player2);

            GameManager gameManager = new GameManager();

            gameManager.Add(new Game()
            {
                GameName = "Death Stranding", GameType = "Action", GamePrice = 499, GameReleaseYear = 2018, GameReviewScore = 8.3
            });
            gameManager.Add(new Game()
            {
                GameName = "Days Gone", GameType = "Action,Zombie", GamePrice = 139, GameReleaseYear = 2018, GameReviewScore = 7.3
            });
            gameManager.Add(new Game()
            {
                GameName = "Persona 5", GameType = "JRPG", GamePrice = 99, GameReleaseYear = 2015, GameReviewScore = 9.1
            });
            gameManager.Add(new Game()
            {
                GameName = "Cyberpunk 2077", GameType = "RPG", GamePrice = 499, GameReleaseYear = 2020, GameReviewScore = 7.1
            });
            gameManager.Add(new Game()
            {
                GameName = "Witcher 3", GameType = "RPG", GamePrice = 49, GameReleaseYear = 2015, GameReviewScore = 9.3
            });

            while (true)
            {
                Console.WriteLine("**********MENU**********");
                Console.WriteLine("1-)Oyuncu Ekle\n2-)Oyuncu Sil\n3-)Kullanıcıları Listele\n4-)Oyun Ekle\n5-)Oyun Sil\n6-)Oyunları Listele\n7-)Oyunları İnceleme Puanına Göre Listele\n8-)Oyunları Çıkış Yıllarına Göre Sırala\n9-)Kampanya Seçiniz\n10-)Çıkış");
                Console.WriteLine("************************");
                int choice = Convert.ToInt32(Console.ReadLine());
                Console.Clear();

                if (choice == 1)
                {
                    Console.WriteLine("Eklemek istediğiniz kullanıcı bilgilerini giriniz");
                    Console.WriteLine("Tc no:");
                    string TcNo = Console.ReadLine();
                    Console.WriteLine("Ad:");
                    string PlayerName = Console.ReadLine();
                    Console.WriteLine("Soyad:");
                    string PlayerSurname = Console.ReadLine();
                    Console.WriteLine("Doğum Yılı:");
                    int BirthYear = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Kaç yıl kullanmayı taahhüt ediyorsunuz:");
                    int UndertakingYear = Convert.ToInt32(Console.ReadLine());

                    playerManager.Add(new NewGamer()
                    {
                        TcNo = TcNo, GamerName = PlayerName, GamerSurname = PlayerSurname, BirthYear = BirthYear, UndertakingYear = UndertakingYear
                    });
                }

                else if (choice == 2)
                {
                    Console.WriteLine("Silmek istediğiniz oyuncunun Tc Numarasını giriniz:");
                    playerManager.Delete(Console.ReadLine());
                }

                else if (choice == 3)
                {
                    playerManager.ListPlayer();
                }

                else if (choice == 4)
                {
                    Console.WriteLine("Eklemek istediğiniz oyunun bilgilerini giriniz");
                    Console.WriteLine("Oyun Adı:");
                    string GameName = Console.ReadLine();
                    Console.WriteLine("Oyunun Çıkış Yılı:");
                    int GameReleaseYear = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Oyunun Türü:");
                    string GameType = Console.ReadLine();
                    Console.WriteLine("Oyunun Fiyatı:");
                    double GamePrice = Convert.ToDouble(Console.ReadLine());
                    Console.WriteLine("Oyunun İnceleme Puanı:");
                    double GameReviewScore = Convert.ToDouble(Console.ReadLine());

                    gameManager.Add(new Game()
                    {
                        GameName = GameName, GameReleaseYear = GameReleaseYear, GameType = GameType, GamePrice = GamePrice, GameReviewScore = GameReviewScore
                    });
                }

                else if (choice == 5)
                {
                    Console.WriteLine("Silmek istediğiniz oyunun Adını giriniz:");
                    gameManager.Delete(Console.ReadLine());
                }

                else if (choice == 6)
                {
                    gameManager.ListGame();
                }

                else if (choice == 7)
                {
                    gameManager.SortByReviewScores();
                }
                else if (choice == 8)
                {
                    gameManager.SortByReleaseYear();
                }
                else if (choice == 9)
                {
                    while (true)
                    {
                        Console.WriteLine("**********KAMPANYALAR**********");
                        Console.WriteLine("-1-Öğrenci Kampanyası\n-2-Kara Cuma Kampanyası\n-3-Ana Menüye Dön");
                        Console.WriteLine("*******************************");

                        int choice2 = Convert.ToInt32(Console.ReadLine());
                        Console.Clear();

                        if (choice2 == 1)
                        {
                            gameManager.ListGame();
                            Console.WriteLine("Yukarıdaki oyunlardan öğrencisi kampanyası uygulamak istediğiniz oyunun adını yazınız:");
                            string name = Console.ReadLine();
                            Console.Clear();
                            ICampaignService campaign = new StudentCampaign();
                            gameManager.GetGame(name, campaign);
                        }
                        else if (choice2 == 2)
                        {
                            gameManager.ListGame();
                            Console.WriteLine("Yukarıdaki oyunlardan kara cuma kampanyası uygulamak istediğiniz oyunun adını yazınız:");
                            string name = Console.ReadLine();
                            Console.Clear();
                            ICampaignService campaign = new BlackFridayCampaign();
                            gameManager.GetGame(name, campaign);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    Console.WriteLine("Programdan çıkış yaptınız.\nİyi günler...");
                    break;
                }
            }
        }
Exemplo n.º 24
0
        static void Main(string[] args)
        {
            GamerManager gamer1 = new GamerManager();
            GamerManager gamer2 = new GamerManager();
            GamerManager gamer3 = new GamerManager();

            gamer1.Id        = 10;
            gamer1.Ad        = "Ahmet";
            gamer1.Soyad     = "Yılmaz";
            gamer1.DogumYili = "1996";
            gamer1.TcNo      = "111222333";

            gamer2.Id        = 11;
            gamer2.Ad        = "Mustafa";
            gamer2.Soyad     = "Türkmen";
            gamer2.DogumYili = "1993";
            gamer2.TcNo      = "444222333";

            gamer3.Id        = 12;
            gamer3.Ad        = "Selim";
            gamer3.Soyad     = "Yüksel";
            gamer3.DogumYili = "1997";
            gamer3.TcNo      = "555222111";

            Registry kayıt = new Registry();

            kayıt.Kayıt(gamer1);
            kayıt.Kayıt(gamer2);
            kayıt.Kayıt(gamer3);

            GameManager game1 = new GameManager();
            GameManager game2 = new GameManager();
            GameManager game3 = new GameManager();

            game1.OyunAdi         = "Doom";
            game1.OyunFiyati      = 67;
            game1.IndirimliFiyat  = 23;
            game1.IndirimliFiyat2 = 31;

            game2.OyunAdi         = "Witcher 3 Wild Hunt";
            game2.OyunFiyati      = 52;
            game2.IndirimliFiyat  = 18;
            game2.IndirimliFiyat2 = 24;

            game3.OyunAdi         = "Half Life";
            game3.OyunFiyati      = 18;
            game3.IndirimliFiyat  = 3;
            game3.IndirimliFiyat2 = 9;

            SaleManager     saleManager     = new SaleManager();
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(game2);
            campaignManager.Add(game1);
            campaignManager.Update(game3);

            saleManager.Sell(gamer1, game2);
            saleManager.Sell(gamer2, game1);
            saleManager.Sell(gamer3, game3);

            campaignManager.Delete(game2);
            campaignManager.Delete(game1);
            campaignManager.Delete(game3);
        }
Exemplo n.º 25
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();

            gamer1.Name        = "Emre";
            gamer1.LastName    = "Aydın";
            gamer1.TCNo        = "1234567890";
            gamer1.DateOfBirth = 2002;
            gamer1.GamerId     = 1;

            Gamer gamer2 = new Gamer();

            gamer2.Name        = "Ahmet";
            gamer2.LastName    = "Keleş";
            gamer2.TCNo        = "3216549870";
            gamer2.DateOfBirth = 2007;
            gamer2.GamerId     = 2;

            Gamer gamer3 = new Gamer();

            gamer3.Name        = "Yunus";
            gamer3.LastName    = "Öz";
            gamer3.TCNo        = "543219876";
            gamer3.DateOfBirth = 1995;
            gamer3.GamerId     = 3;

            Games games1 = new Games();

            games1.GameId    = 1;
            games1.GameName  = "PUBG";
            games1.GamePrice = 50;

            Games games2 = new Games();

            games2.GameId    = 2;
            games2.GameName  = "Counter Strike Global Offensive";
            games2.GamePrice = 40;

            Games games3 = new Games();

            games3.GameId    = 3;
            games3.GameName  = "Cyberpunk 2077";
            games3.GamePrice = 250;



            GamerManager gamerManager = new GamerManager();

            gamerManager.Add(new Gamer {
                GamerId = 4, Name = "Emir", LastName = "Aras", TCNo = "456789123", DateOfBirth = 2017
            });
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);

            GameManager gameManager = new GameManager();

            gameManager.Add(new Games {
                GameId = 4, GameName = "League Of Legends", GamePrice = 20
            });
            gameManager.Update(games1);
            gameManager.Delete(games1);


            SummerSale summerSale = new SummerSale();

            summerSale.DıscountForGame(games1);

            WinterSale winterSale = new WinterSale();

            winterSale.DıscountForGame(games2);

            SummerSale summerSale1 = new SummerSale();

            summerSale.FınıshtoDiscount(games3);

            DıscountManager dıscountManager = new DıscountManager();

            dıscountManager.Dıscount(games1, gamer1);

            Campaign campaign1 = new Campaign();

            campaign1.CampaignName       = "Black Friday";
            campaign1.CampaignId         = 1;
            campaign1.CampaignPercentage = 25;

            DıscountManager dıscountManager1 = new DıscountManager();

            dıscountManager1.Add(campaign1);
        }