static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(); Player player1 = new Player(); Player player2 = new Player(); player1.Name = "Serkan"; player1.surName = "Önder"; player1.TCNo = "12345678910"; player1.birthDate = "16012000"; player2.Name = "Argun"; player2.surName = "Asar"; player2.TCNo = "1234566789"; player2.birthDate = "28121999"; playerManager.Add(player1); playerManager.ShowPlayer(player1); playerManager.Update(player1); playerManager.Campaignz(player1, new Campaign1()); playerManager.Delete(player1); playerManager.Add(player2); playerManager.ShowPlayer(player2); playerManager.Update(player2); playerManager.Campaignz(player2, new Campaign3()); playerManager.Delete(player2); }
static void Main(string[] args) { IEntityService entityService = new PlayerManager(); entityService.Add(new Player() { Id = 1, PlayerName = "Ayşenur", PlayerSurname = "Tunç", BirthDate = 1998, NationalityId = "12345678910" }); entityService.Add(new Player() { Id = 2, PlayerName = "Dilara", PlayerSurname = "Ünsal", BirthDate = 1995, NationalityId = "12345678912" }); IGameManager gameManager = new GameManager(); gameManager.Add(new Game() { GameId = 1, GameName = "League of Legends", GamePrice = 500, GameType = "MOBA" }); gameManager.Add(new Game() { GameId = 2, GameName = "Witcher", GamePrice = 200, GameType = "RPG" }); gameManager.Delete(new Game() { GameName = "League of Legends" }); gameManager.SalesGame(new Game() { GameName = "League of Legends" }, new Player() { PlayerName = "Ayşenur" }); ICampaign campaign = new CampaignManager(); campaign.Add(new Campaign() { Id = 1, Name = "Kara Cuma İndirimi", DiscountRate = "%50" }); campaign.Add(new Campaign() { Id = 2, Name = "Öğrenci İndirimi", DiscountRate = "%65" }); campaign.Delete(new Campaign() { Id = 2, Name = "Öğrenci İndirimi", DiscountRate = "%65" }); campaign.CalculateDiscount(new Campaign() { Id = 1, Name = "Kara Cuma İndirimi", DiscountRate = "%50" }); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new UserValidationManager()); Player player = new Player { Id = 1, FirstName = "EMRAH", LastName = "RAMAZAN", BirthYear = 1991, IdentityNumber = 11111111111 }; playerManager.Add(player); playerManager.Update(player); playerManager.Delete(player); GameManager gameManager = new GameManager(); Game game = new Game { Id = 1, Name = "Call Of Duty", UnitPrice = 500 }; gameManager.Add(game); gameManager.Update(game); gameManager.Delete(game); CampaignManager campaignManager = new CampaignManager(); Campaign campaign = new Campaign { Id = 1, Name = "Savaş Oyununda İndirim", Discount = 50 }; campaignManager.Add(campaign); campaignManager.Update(campaign); campaignManager.Delete(campaign); SaleManager saleManager = new SaleManager(); saleManager.Sale(player, game); saleManager.CampaignSale(player, game, campaign); }
static void Main(string[] args) { IPersonDol playerManager = new PlayerManager(); Player player = new Player() { Id = 1, BirthYear = 2001, FirstName = "Fatih", LastName = "Çayır", TC = 1235 }; Game game = new Game() { Id = 1, Name = "CS:GO", UnitPrice = 10 }; UserValidationManager userValidation = new UserValidationManager(); if (userValidation.Validate(player) == true) { playerManager.Add(player); } else { Console.WriteLine("Doğrulama başarısız"); } SellingManager selling = new SellingManager(); selling.Sell(); CampaignManager campaign = new CampaignManager(); campaign.EndOfYearCampaign(player, game); campaign.Delete(); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new UserValidationManager()); playerManager.Add(new Player { Id = 1, BirthYear = 1996, FirstName = "Esra", LastName = "Öksüz", TCNO = 12345 }); CampaignManager campaignManager = new CampaignManager(); campaignManager.Update(new Campaign { Id = 3, CampaignName = "Gamers Month", DiscountPercentage = 50 }); OrderManager orderManager = new OrderManager(); orderManager.CreateOrder(new Player { Id = 1, BirthYear = 1996, FirstName = "Esra", LastName = "Öksüz", TCNO = 12345 }, new Campaign { Id = 5, DiscountPercentage = 30, CampaignName = "ValentinesDayDiscount" }); Console.ReadLine(); }
static void Main(string[] args) { Player player1 = new Player { FirstName = "Mert", LastName = "Özdemir", Id = 1, IdentityNumber = 123465789, YearOfBirth = 1986 }; Player player2 = new Player { FirstName = "Ahmet", LastName = "Yıldız", Id = 2, IdentityNumber = 1234657890, YearOfBirth = 1985 }; Game game1 = new Game { Id = 1, Name = "PUBG", UnitPrice = 250 }; userValidationManager userValidationManager = new userValidationManager(); GameSalesPlatformManager gameSalesPlatformManager = new GameSalesPlatformManager(); CampaignManager campaignManager = new CampaignManager(); PlayerManager playerManager = new PlayerManager(new userValidationManager()); playerManager.Add(player1); playerManager.Delete(player2); playerManager.Update(player2); gameSalesPlatformManager.Sale(player2, game1); campaignManager.NewYearCampaign(player1, game1); campaignManager.NewYearCampaign(player2, new Game { Id = 2, Name = "CS", UnitPrice = 400 }); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new PlayerValidationManager()); //PlayerManager playerManager = new PlayerManager(new NationalityValidationManager()); // Yukarıda iki farklı ValidationService birbiri arasında switch edilebilecektir. playerManager.Add(new Player { BirthDay = Convert.ToDateTime("30.01.1985"), FirstName = "ENGİN", LastName = "DEMİROĞ", Id = 1, TcNo = 12345678910 }); List <Player> playersList = playerManager.GetAllPlayers(); foreach (var item in playersList) { Console.WriteLine(item.FirstName); } CampaignManager campaignManager = new CampaignManager(); campaignManager.CampaignAdd(new Game { GameName = "WarCaraft" }); OrderManager order = new OrderManager(new PlayerValidationManager(), campaignManager); order.GameOrder(playersList.Find(p => p.FirstName == "ENGİN"), new Game { GameName = "WarCaraft" }); }
static void Main(string[] args) { Player player1 = new Player() { PlayerFirstName = "Arda Cenker", PlayerLastName = "Karagöz", Birthday = 2005, TcNo = "456161268486" }; Player player2 = new Player() { PlayerFirstName = "Ahmet", PlayerLastName = "Uçan", Birthday = 2009, TcNo = "516515455135" }; Player player3 = new Player() { PlayerFirstName = "Burak", PlayerLastName = "Kuş", Birthday = 2007, TcNo = "115156456166" }; PlayerManager playerManager = new PlayerManager(); playerManager.Add(player1); playerManager.Update(player2); playerManager.Delete("115156456166"); Games game1 = new Games(); game1.GameName = "Assassin's Creed : Valhalla"; game1.GameType = "Open World Action"; game1.GameId = 1; game1.GamePrice = 249.90; Games game2 = new Games(); game2.GameName = "Need For Speed : Heat"; game2.GameType = "Racing"; game2.GameId = 2; game2.GamePrice = 149.90; Games game3 = new Games(); game3.GameName = "Doom Eternal"; game3.GameType = "FPS Shooter"; game3.GameId = 3; game3.GamePrice = 119.90; Games game4 = new Games(); game4.GameName = "Euro Truck Simulator"; game4.GameType = "Simulation"; game4.GameId = 4; game4.GamePrice = 29.90; GameManager games = new GameManager(); games.Add(game1); games.Update(game2); games.Delete("Doom Eternal"); //games.BuyGame("Euro Truck Simulator"); }
static void Main(string[] args) { Player player1 = new Player { Id = 1, FirstName = "Gizem", LastName = "Tok", NationalityId = "1234567899", DateOfBirthYear = 1995 }; Player player2 = new Player { Id = 2, FirstName = "Murat", LastName = "Işık", NationalityId = "1234867099", DateOfBirthYear = 1998 }; IPlayerService playerService = new PlayerManager(new PlayerCheckManager()); IPlayerCheckService playerCheckService = new PlayerCheckManager(); playerService.Add(player1); playerService.Add(player2); Game game1 = new Game { Id = 1, GameName = "FİFA", GamePrice = 300, GameReleaseYear = 2005 }; Game game2 = new Game { Id = 2, GameName = "GTA", GamePrice = 200, GameReleaseYear = 2003 }; IGameService gameService = new GameManager(); gameService.Sell(player2); ICampaignService campaignService = new CampaignManager(); Campaign campaign1 = new Campaign { Id = 1, Name = "haftasonu indirimi", Discount = 0.2 }; Campaign campaign2 = new Campaign { Id = 2, Name = "öğrenci indirimi", Discount = 0.5 }; campaignService.Add(campaign2); campaignService.Delete(campaign1); }
static void Main(string[] args) { Player player1 = new Player() { TCNo = "22222222222", FirstName = "Engin", LastName = "Demiroğ", NickName = "The SOLID Developer", YearofBirth = "1985" }; User user1 = new User() { TCNo = "22222222222", FirstName = "Engin", LastName = "Demiroğ", YearofBirth = "1985" }; Game game1 = new Game() { GameName = "Rocket League", GamePrice = 30 }; VerifyManager verifyManager = new VerifyManager(); verifyManager.Verification(player1, user1); PlayerManager playerManager1 = new PlayerManager(); playerManager1.Add(player1); GameManager gameManager = new GameManager(); gameManager.Add(game1); ICampaign winterSale = new WinterSale(); winterSale.Update(game1); GameManager gameManager1 = new GameManager(); gameManager1.Sell(game1, player1); winterSale.Delete(game1); playerManager1.Delete(player1); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new ValidationManager()); playerManager.Add(new Player { Id = 1, FirstName = "Enis", LastName = "Işık", DateOfBirth = new DateTime(1990, 1, 6), NationalityId = "43655276468" }); Player player = new Player { FirstName = "Smith", LastName = "Johnson", Id = 2 }; Player player2 = new Player { FirstName = "Elon", LastName = "Musk", Id = 3 }; Game game = new Game { Name = "Star Wars", Id = 5 }; Game game2 = new Game { Name = "Hitman", Id = 10 }; Campaign campaign = new Campaign { Name = "Steam Autumn Sale is Here!", CampaignEnd = "02.12.2021", DisountRate = 15 }; SalesManager sales = new SalesManager(); sales.Sale(player, game); SalesManager sales2 = new SalesManager(); sales2.Sale(player2, game2, campaign); }
static void Main(string[] args) { string TC; Campaign campaign = new Campaign(); Game game = new Game(); game.GameName = "oyun1"; game.GamePrice = 105; Player player = new Player(); player.UserName = "******"; player.Password = "******"; // player.Id = 1; player.FirstName = "canan"; player.LastName = "soba"; player.NationalityId = "1234569852"; // player.DateOfBirth = DateTime.Today; GameManager gameManager = new GameManager(); gameManager.Add(game); PlayerManager playerManager = new PlayerManager(); List <Game> games = new List <Game>() { game }; List <Player> players = new List <Player>() { player }; gameManager.Sell(games, players); playerManager.Add(players); ICampaignManager campaignManager = new Sale(); gameManager.CompainGame(games, game.GameName, campaignManager); gameManager.Delete(games); //Console.WriteLine("Silmek istediğiniz kişinin TC Kimlik numarasını giriniz."); //TC = Convert.ToString(Console.ReadLine()); //playerManager.Delete(TC); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new PlayerValidation()); Player player = new Player(); player.Id = 1; player.Tc = "111111111111"; player.Name = "Eren"; player.NickName = "AbsinThec"; player.SurName = "Ugur"; player.YearOfBirth = "1999"; playerManager.Add(player); ProductManager productManager = new ProductManager(); Product game = new Product(); game.Id = 1; game.Name = "CS:GO"; game.Price = 80; Product game2 = new Product(); game2.Id = 2; game2.Name = "Blazing Sails"; game2.Price = 20; Product[] products = new Product[] { game, game2 }; productManager.Sell(game, player); PromotionManager promotionManager = new PromotionManager(); Promotion promotion = new Promotion(); promotion.PromotionName = "Yaz Kampanyası"; promotion.Id = 1; promotion.Percent = 50; promotionManager.Add(promotion); promotionManager.Promote(promotion, products); }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new ValidationManager()); playerManager.Add(new Player { Id = 1, BirthYear = 1990, FirstName = "Ted", LastName = "Mosby", IdentityNumber = 12345 }); Player player = new Player(); player.FirstName = "smt"; player.Id = 2; Player player2 = new Player(); player2.FirstName = "ted"; player2.LastName = "mosby"; Game game = new Game(); game.Name = "pacman"; Game game2 = new Game(); game2.Name = "mario"; Campaign campaign = new Campaign(); campaign.Name = "chrismas"; SalesManager sales = new SalesManager(); sales.Sale(player, game); SalesManager sales2 = new SalesManager(); sales2.Sale(player2, game2, campaign); }
static void Main(string[] args) { BasePlayerManager playerManager = new PlayerManager(); playerManager.Add(new Player { FirstName = "Kevser", LastName = "Canca", NationalityId = "37229058689", NickName = "KvsrCn" }); BasePlayerManager playerManager1 = new PlayerManager(); playerManager1.Update(new Player { FirstName = "Kevser", LastName = "CANCA", NationalityId = "37229058689", NickName = "Kvsr" }); BasePlayerManager playerManager2 = new PlayerManager(); playerManager2.Delete(new Player { FirstName = "Kağan", LastName = "Canca", NationalityId = "32234789098", NickName = "Kğn" }); BasePlayerManager gameManager = new GameManager(); gameManager.BuyGame(new Game { Id = 1, Name = "Green World", Price = 100 }); Console.ReadLine(); }
static void Main(string[] args) { OldPlayer player1 = new OldPlayer(); player1.Id = 1; player1.TcNo = "12345678901"; player1.PlayerName = "Bircan"; player1.PlayerLastName = "ÇİFTÇİ"; player1.DateOfBirth = new DateTime(1998, 8, 21); player1.GameDegree = "Gold 1"; OldPlayer player2 = new OldPlayer(); player2.Id = 2; player2.TcNo = "12345678910"; player2.PlayerName = "Serhat"; player2.PlayerLastName = "DEVECİ"; player2.DateOfBirth = new DateTime(1997, 8, 8); player2.GameDegree = "Platinum 1"; NewPlayer player3 = new NewPlayer(); player3.Id = 3; player3.TcNo = "12345678910"; player3.PlayerName = "Serhat"; player3.PlayerLastName = "DEVECİ"; player3.DateOfBirth = new DateTime(1986, 5, 16); player3.MembershipReference = "Ocak1234"; PlayerManager playerManager = new PlayerManager(); playerManager.Add(); playerManager.Delete(); playerManager.Update(); Games games1 = new Games(); games1.Id = 1; games1.GameName = "LOL"; games1.GameType = "Strategy"; games1.GamePrice = 25; games1.GameYear = 2010; Games games2 = new Games(); games2.Id = 2; games2.GameName = "Days Gone"; games2.GameType = "Action"; games2.GamePrice = 50; games2.GameYear = 2018; GameCampaign campaing1 = new GameCampaign(); campaing1.Id = 1; campaing1.CampaignName = "New Years"; campaing1.Campaign = 10; GameCampaign campaing2 = new GameCampaign(); campaing2.Id = 1; campaing2.CampaignName = "Student"; campaing2.Campaign = 20; GameCampaign campaign = new GameCampaign(); campaign.CampaignAdd(); campaign.CampaignDelete(); campaign.CampaingUpdate(); GameManager gameManager = new GameManager(); gameManager.Add(games1); gameManager.Add(games2); GameSale gameSale1 = new GameSale(player1, games1, campaing1); gameSale1.GameSales(); GameSale gameSale2 = new GameSale(player2, games2, campaing2); gameSale2.GameSales(); }
static void Main(string[] args) { IPlayer player1 = new OldPlayer() { TcNo = "1", BirthYear = 1998, PlayerName = "Seçkin", PlayerSurname = "Bakir", MembershipYear = 2 }; IPlayer player2 = new OldPlayer() { TcNo = "2", BirthYear = 1985, PlayerName = "Engin", PlayerSurname = "Demiroğ", MembershipYear = 20 }; PlayerManager playerManager = new PlayerManager(); 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-)Kampanya Seçiniz\n9-)Çı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 NewPlayer() { TcNo = TcNo, PlayerName = PlayerName, PlayerSurname = 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 oyuncunun Adını giriniz:"); gameManager.Delete(Console.ReadLine()); } else if (choice == 6) { gameManager.ListGame(); } else if (choice == 7) { gameManager.SortByReviewScores(); } else if (choice == 8) { 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; } } }
static void Main(string[] args) { Player player1 = new Player(); player1.Id = 1; player1.FirstName = "Tuğçe"; player1.LastName = "Kadem"; player1.DateOfBirth = new DateTime(2000, 11, 17); player1.NationaltyId = "123456789"; Player player2 = new Player(); player2.Id = 2; player2.FirstName = "Yiğit"; player2.LastName = "Karademir"; player2.DateOfBirth = new DateTime(1998, 7, 15); player2.NationaltyId = "987654321"; PlayerManager playerManager1 = new PlayerManager(new MernisServiceAdapters()); playerManager1.Add(player1); playerManager1.Update(player1); playerManager1.Delete(player2); Game game1 = new Game(); game1.Id = 1; game1.GameName = "oyun 1"; game1.GamePrice = 150; Game game2 = new Game(); game2.Id = 2; game2.GameName = "oyun 2"; game2.GamePrice = 100; SalesManager salesManager = new SalesManager(); salesManager.Sales(player1, game1); Campaign campaign1 = new Campaign(); campaign1.Id = 1; campaign1.CampaignName = "kampanya 1"; campaign1.DiscountRate = 50; Campaign campaign2 = new Campaign(); campaign2.Id = 2; campaign2.CampaignName = "kampanya 2"; campaign2.DiscountRate = 30; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign2); campaignManager.Update(campaign2); SalesManager salesManager1 = new SalesManager(); salesManager1.CampaignSales(player1, game2, campaign1); }
static void Main(string[] args) { Player player1 = new Player() { TcNo = "123456789", FirstName = "Yaren", LastName = "Şahin", BirthDateYear = 1998 }; Player player2 = new Player() { TcNo = "987654321", FirstName = "Ali", LastName = "Kara", BirthDateYear = 1997 }; Game myGame = new Game() { Name = "MyGame", Price = 100 }; Console.WriteLine("-------------Welcome-------------"); GameManager gameManager = new GameManager(); IPlayerCheckService playerCheckService = new PlayerCheckManager(); PlayerManager playerManager = new PlayerManager(playerCheckService); CampaignManager salesManager = new CampaignManager(); ICampaign newCampaign = new NewCampaign(); ICampaign blackFridayCampaign = new BlackFridayCampaign(); ICampaign summerCampaign = new SummerCampaign(); List <Player> listPlayer = new List <Player>() { player1, player2 }; List <ICampaign> campaigns = new List <ICampaign>() { blackFridayCampaign, summerCampaign }; gameManager.Display(myGame); Console.WriteLine("Please choose an option:"); Console.WriteLine("1)Add player\n2)Update player\n3)Delete player\n4)Buy the game\n5)Display campaigns\n" + "6)Apply Discount\n7)Add a new campaign\n8)Update the campaign\n9)Delete the campaign\n10)Exit"); int x = Convert.ToInt32(Console.ReadLine()); switch (x) { case 1: Player player = new Player(); Console.WriteLine("Tc No:"); player.TcNo = Console.ReadLine(); Console.WriteLine("First Name:"); player.FirstName = Console.ReadLine(); Console.WriteLine("Last Name:"); player.LastName = Console.ReadLine(); Console.WriteLine("BirthDateYear:"); player.BirthDateYear = Convert.ToInt32(Console.ReadLine()); playerManager.Add(player); break; case 2: playerManager.Update(player1); break; case 3: playerManager.Delete(player1); break; case 4: gameManager.Buy(player1); break; case 5: salesManager.DisplayCampaigns(campaigns); break; case 6: salesManager.ApplyDiscount(myGame); break; case 7: salesManager.AddNewCampaign(newCampaign); break; case 8: salesManager.UpdateCampaign(blackFridayCampaign); break; case 9: salesManager.DeleteCampaign(summerCampaign); break; case 10: break; default: Console.WriteLine("Invalid choice"); break; } }
static void Main(string[] args) { PlayerManager playerManager = new PlayerManager(new UserCheckManager()); CampaignManager campaignManager = new CampaignManager(); SalesManager salesManager = new SalesManager(); Game game1 = new Game { Id = 1, Name = "PlayerUnknown's Battlegrounds", Price = 87 }; Game game2 = new Game { Id = 2, Name = "Counter-Strike: Global Offensive", Price = 127 }; Game game3 = new Game { Id = 3, Name = "Valorant", Price = 50 }; Console.WriteLine("\n------ Kullanıcı Ekle Sil Güncelle Yönetimi-------\n"); Players player1 = new Players() { Id = 1, FirstName = "Ahmet", LastName = "Yılmaz", BirtDateYear = "1986", NationalId = 123456789 }; playerManager.Add(player1); playerManager.Update(player1); playerManager.Delete(player1); Console.WriteLine("\n------ Kampanya Ekle Sil Güncelle Yönetimi -------\n"); Campaign campaign1 = new Campaign { CampignName = "Yeni Oyuncu İndirimi", DiscountRate = 0.1 }; Campaign campaign2 = new Campaign { CampignName = "Kış İndirimi", DiscountRate = 0.2 }; Campaign campaign3 = new Campaign { CampignName = "Yeni Sezon İndirimi", DiscountRate = 0.3 }; campaignManager.Add(campaign1); campaignManager.Update(campaign2); campaignManager.Delete(campaign1); Console.WriteLine("\n------ Normal Satış -------\n"); salesManager.SellGame(player1, game3); Console.WriteLine("\n------ Kampanyalı Satış -------\n"); salesManager.CampaignGame(player1, game2, campaign2); Console.WriteLine(); salesManager.CampaignGame(player1, game1, campaign3); }