public void Add(Games games) { Console.WriteLine(games.GameName + " " + "oyunu eklendi."); }
public void Delete(Games games) { Console.WriteLine(games.GameName + " " + "oyunu silindi."); }
public void Update(Games games) { Console.WriteLine(games.GameName + " " + "oyunu güncellendi."); }
public GameSale(Player player, Games games, GameCampaign gameCampaign) { gamePrice = games.GamePrice; campaigns = gameCampaign.Campaign; }
public void Purchase(Gamer gamer, Games games, Campaign campaign) { Console.WriteLine(gamer.FirstName + " " + games.Name + " oyununu " + campaign.CampaingName + " kampanyası ile" + " başarıyla satın aldı."); }
//GamerManager'i kullanarak gamer'ı kayıt ettiğimizde çalışabilmek için //bir doğrulama servisine ihiyaç duyarız.Doğrulama sınıfının kim olduğunu belirtiriz(UserValidationManager) static void Main(string[] args) { GamerManager gamermanager = new GamerManager(new NewEStateUserValidationManager()); gamermanager.Add(new Gamer { Id = 1, BirthYear = 1991, FirstName = "AYKUT", LastName = "COŞKUN", IdentityNumber = 123456 }); Console.WriteLine(); Campaign campaign1 = new Campaign() { CampaignId = 1, CampaignName = "Üyelik indirimi", CampaignDetails = "Yeni üye olana bir ay indirim", RateofDiscount = 25 }; Campaign campaign2 = new Campaign() { CampaignId = 2, CampaignName = "Kış fırsatı", CampaignDetails = "Kış ayları boyunca geçerlidir", RateofDiscount = 40 }; CampaignManager campaignmanager = new CampaignManager(); campaignmanager.Add(campaign1); campaignmanager.Add(campaign2); campaignmanager.Update(campaign2); Console.WriteLine(); Gamer gamer1 = new Gamer() { Id = 1, FirstName = "Engincan", LastName = "Coşkun", BirthYear = 2003, IdentityNumber = 13579 }; Gamer gamer2 = new Gamer() { Id = 2, FirstName = "İlhan", LastName = "Coşkun", BirthYear = 1986, IdentityNumber = 24680 }; Console.WriteLine(); Games game1 = new Games() { GameId = 111, GameName = "Call of Duty", GamePrice = 150 }; Games game2 = new Games() { GameId = 222, GameName = "NBA 2K21", GamePrice = 250 }; Games game3 = new Games() { GameId = 333, GameName = "FİFA 2021", GamePrice = 350 }; SaleManagement salemanagement = new SaleManagement(); salemanagement.Buy(gamer1, campaign1, game3); salemanagement.Buy(gamer2, campaign2, game1); }
public double Sale(Games game, Campaigns campaign) { return(game.Price * campaign.Sale); }
static void Main(string[] args) { IGamerService gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(new Gamer { FirstName = "Ediz", SurName = "Züm", BirthYear = 2001, IdentitiyNumber = 12345678910, }); gamerManager.Delete(new Gamer { FirstName = "Ediz", SurName = "Züm", BirthYear = 2001, IdentitiyNumber = 12345678910, }); gamerManager.Update(new Gamer { FirstName = "Ediz", SurName = "Züm", BirthYear = 2001, IdentitiyNumber = 12345678910, }); Gamer gamer1 = new Gamer(); gamer1.FirstName = "Ediz"; gamer1.SurName = "Züm"; gamer1.BirthYear = 2001; gamer1.IdentitiyNumber = 12345678910; Gamer gamer2 = new Gamer(); gamer2.FirstName = "Umut"; gamer2.SurName = "Mırrıkoğlu"; gamer2.BirthYear = 2002; gamer2.IdentitiyNumber = 12345678911; Gamer gamer3 = new Gamer(); gamer3.FirstName = "Güney"; gamer3.SurName = "Taran"; gamer3.BirthYear = 2002; gamer3.IdentitiyNumber = 12345678912; Games game1 = new Games(); game1.GameName = "GAME1"; game1.GameType = "WAR"; game1.Price = 89.90; game1.Point = 4.2; Games game2 = new Games(); game2.GameName = "GAME2"; game2.GameType = "ADVENTURE"; game2.Price = 90.90; game2.Point = 3.7; Games game3 = new Games(); game2.GameName = "GAME3"; game2.GameType = "STRATEGY"; game2.Price = 85.90; game2.Point = 4.7; Games[] games = new Games[] { game1, game2, game3 }; GamesManager gamesManager = new GamesManager(); gamesManager.AddToCart(game1, gamer1); gamesManager.BuyGame(game2, gamer3); }
public void Add(Games games1) { games.Add(games1); Console.WriteLine("Yeni Oyun Eklendi : " + games1.GameName); }
static void Main(string[] args) { //Oyuncu Ekleme işlemi GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(new Gamer { Id = 1, BirthOfYear = 1985, FirstName = "BARIŞ", LastName = "DERİN", IdentityNumber = 12345678910 }); Gamer gamer1 = new Gamer() { Id = 1, FirstName = "BARIŞ", LastName = "DERİN", IdentityNumber = 12345678910, BirthOfYear = 1985 }; gamerManager.Add(gamer1); gamerManager.Delete(gamer1); gamerManager.Update(gamer1); GamerManager gamerManager2 = new GamerManager(new UserValidationManager()); gamerManager2.Add(new Gamer { Id = 1, BirthOfYear = 1985, FirstName = "AYŞE", LastName = "KORKUT", IdentityNumber = 34545678910 }); Console.WriteLine("\n**********"); //Oyun ekleme işlemi GameManager gameManager = new GameManager(); Games game1 = new Games { Id = 1, GameName = "PBG", GamePrice = 100 }; Games game2 = new Games { Id = 2, GameName = "Survive", GamePrice = 120 }; Games game3 = new Games { Id = 3, GameName = "Mario", GamePrice = 150 }; gameManager.Add(game1); gameManager.Delete(game2); gameManager.Update(game3); Console.WriteLine("\n**********"); //Kampanya Ekledik CampaignManager campaignManager = new CampaignManager(); Campaign campaign1 = new Campaign { CampaignId = 4, CampaignName = "Sepette %25 indirim", CampaignAmount = 25 }; campaignManager.Add(campaign1); Campaign campaign2 = new Campaign { CampaignId = 5, CampaignName = "Sepette %10 indirim", CampaignAmount = 10 }; campaignManager.Delete(campaign2); Console.WriteLine("\n**********"); //Satış manager classına eklediğimiz oyun,oyuncu ve kampanyayı parametre ile gönderdik. //SalesManager classına gidip bakabilirsin.satış işlemi orda gerçekleşti. SalesManager salesManager = new SalesManager(); salesManager.Sales(game1, gamer1, campaign1); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("KAYIT EKLEME"); Customer customer = new Customer(); customer.FirstName = "Şeyma Nur"; customer.LastName = "Aksoy"; customer.NationalyId = 12752239584; customer.Birthday = 2000; Customer customer1 = new Customer(); customer1.FirstName = "Şeyda Nur"; customer1.LastName = "Yılmaz"; customer1.NationalyId = 12252239584; customer1.Birthday = 2000; BaseCustomerManager manager = new CustomerManager((new MernisAdapter())); manager.Save(new Entities.Customer { Birthday = 2002, FirstName = "FAİK", LastName = "AKSOY", NationalyId = 21037963540, Id = 123 }); BaseCustomerManager manager1 = new CustomerManager(new CustomerCheckManager()); manager1.Save(customer); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAYIT SİLME"); manager.Delete(customer); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAYIT GÜNCELLEME"); manager.Update(customer1); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAMPANYA LİSTESİ"); Campaign campaign = new Campaign(); campaign.CampaignName = "Öğrenci Kampanyası"; campaign.CampaignId = 1; Campaign campaign1 = new Campaign(); campaign1.CampaignName = "300 tl üzeri %30 indirim"; campaign1.CampaignId = 2; List <Campaign> lists = new List <Campaign> { campaign, campaign1 }; BaseCampaignManager campaignManager = new CampaignManager(); campaignManager.GetAll(lists); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAMPANYA EKLE"); BaseCampaignManager baseCampaignManager = new CampaignManager(); lists.Add(new Campaign { CampaignId = 3, CampaignName = "500 TL üzeri %40 indirim" }); baseCampaignManager.Save(lists, new Campaign { CampaignId = 3, CampaignName = "500 TL üzeri %40 indirim" }); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAMPANYA SİL"); baseCampaignManager.Delete(campaign); Console.WriteLine("-----------------------------------------"); Console.WriteLine("KAMPANYA GÜNCELLE"); baseCampaignManager.Update(campaign1); Console.WriteLine("-----------------------------------------"); Console.WriteLine("OYUN LİSTELEME "); Games games = new Games(); games.GameName = "LOL"; games.Price = 34; games.Id = 1; Games games1 = new Games(); games1.GameName = "PUBG"; games.Price = 120; games1.Id = 1; List <Games> liste = new List <Games> { games, games1 }; BaseGameManager baseGameManager = new BaseGameManager(); baseGameManager.GetAll(liste); Console.WriteLine("-----------------------------------------"); Console.WriteLine("OYUN SATIŞ "); baseGameManager.Sales(customer, games1, campaign); }
public void AddToCart(Games games, Gamer gamer) { Console.WriteLine(games.GameName + " " + ":Game successfully added to" + " " + gamer.FirstName + "'s" + " cart"); }
public void BuyGame(Games games, Gamer gamer) { Console.WriteLine(gamer.FirstName + " " + "Successfully bought:" + games.GameName); }
public void OrderCancellation(Gamer gamer, Games game) { Console.WriteLine(gamer.Name + " kullanıcısının " + game.GameName + " oyunu için siparişi iptal edildi "); }
public void AddOrder(Gamer gamer, Games game, Campaigns campaign) { Console.WriteLine(gamer.Name + " kullanıcısı " + game.GameName + " oyununu aldı\nKampanyanız: " + campaign.CampaignName); }
public void Sales(Games games, Gamer gamer, Campaign campaign) { int indirimliFiyat = games.GamePrice - campaign.CampaignAmount; Console.WriteLine(gamer.FirstName + " " + "oyuncu" + " " + games.GameName + " " + "oyununu" + " " + campaign.CampaignName + " " + "kampanyası ile " + indirimliFiyat + " " + "TL'den aldı."); }