static void Main(string[] args) { Player player = new Player { PlayerId = 1, DateOfBirth = 1990, FirstName = "xxx", LastName = "yyy", IdentityNumber = 54321 }; Game game = new Game { GameName = "Fallout", GamePrice = 10, GameType = "Role Play" }; GameManager gameManager = new GameManager(); gameManager.Add(game); Campain campain = new Campain { CampainName = "You Are Not Chosen One!", BuyWithDiscount = "%23" }; CampainManager campainManager = new CampainManager(); campainManager.BuyWithDiscount(game, campain, player); }
static void Main(string[] args) { IGamerService gamerManager = new GamerManager(new UserValidationManager()); Gamer gamer = new Gamer { Id = 1, BirthYear = 1996, FirstName = "SEVDENUR", LastName = "DEMİREL", IdentityNumber = 12345 }; gamerManager.Add(gamer); IGameService gameManager = new GameManager(); Game game = new Game { GameName = "League of Legends", Price = 50 }; gameManager.Add(game); ICampainService campainManager = new CampainManager(); Campain campain = new Campain { CampainName = "", Discount = 0 }; SalesManager salesManager = new SalesManager(); salesManager.Sell(gamer, game, campain); Console.ReadLine(); }
public void Sell(Gamer gamer, Game game, Campain campain) { if (campain.Discount == 0) { Console.WriteLine(gamer.FirstName + " " + gamer.LastName + " " + game.GameName + " adlı oyunu " + " satın aldı. Toplam ödenen tutar = " + game.Price); } else { float indirim = game.Price * campain.Discount / 100; float price = game.Price - indirim; Console.WriteLine(gamer.FirstName + " " + gamer.LastName + " " + game.GameName + " adlı oyunu " + campain.CampainName + " kampanyası ile satın aldı. Toplam ödenen tutar = " + price); } }
public void BuyWithDiscount(Game game, Campain campain, Player player) { Console.WriteLine(player.FirstName + " " + player.LastName + " buy the " + game.GameName + "."); }
public void Order(Gamer gamer, Campain campain) { Console.WriteLine("Satış başarılı!"); }
public void Update(Campain campain) { Console.WriteLine("Güncelleme Başarılı!"); }
public void Delete(Campain campain) { Console.WriteLine("Silme Başarılı!"); }
public void Add(Campain campain) { Console.WriteLine("Kampanya Eklendi."); }
public void Add(Campain campain) { Console.WriteLine("Yeni kampanya sisteme eklendi"); }
public void Update(Campain campain) { Console.WriteLine("Seçili kampanya güncelleme işlemi başarılı"); }
public void Delete(Campain campain) { Console.WriteLine("Seçili kampanya silindi"); }