static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new MernisServiceAdapter()); Frisky frisky = new Frisky { Id = 1, FirstName = "Murat", LastName = "Dursun", Date = new DateTime(2000, 08, 21), IdentityID = 27571468336 }; gamerManager.Add(frisky); gamerManager.Update(frisky); gamerManager.Delete(frisky); GameManager gameManager = new GameManager(); Game game = new Game { Id = 1, Name = "7 Days To Die", UnitPrice = 70 }; gameManager.Add(game); gameManager.Update(game); gameManager.Delete(game); CampaignManager campaignManager = new CampaignManager(); Campaign campaign = new Campaign { Id = 1, Name = "Discount on game", Discount = 30 }; campaignManager.Add(campaign); campaignManager.Update(campaign); campaignManager.Delete(campaign); SaleManager saleManager = new SaleManager(); saleManager.Sale(frisky, game); saleManager.CampaignSale(frisky, game, campaign); }
public override void Add(Frisky frisky) { if (gamerCheckService.CheckIfRealPerson(frisky)) { base.Add(frisky); } else { throw new Exception("Not a valid person"); } }
public override void Update(Frisky frisky) { Console.WriteLine("'" + frisky.FirstName + " " + frisky.LastName + "'" + " Users Updated."); }
public virtual void Add(Frisky frisky) { Console.WriteLine(" " + frisky.FirstName + " user added."); }
public virtual void Update(Frisky frisky) { Console.WriteLine(frisky.FirstName + "user updated."); }
public virtual void Delete(Frisky frisky) { Console.WriteLine(frisky.FirstName + " user deleted."); }
public void CampaignSale(Frisky frisky, Game game, Campaign campaign) { Console.WriteLine("'" + frisky.FirstName + " " + frisky.LastName + "'" + " purchased the game named " + "'" + game.Name + "' with " + campaign.Discount + " % discount"); }
public void Sale(Frisky frisky, Game game) { Console.WriteLine("'" + frisky.FirstName + " " + frisky.LastName + "'" + " purchased the game named " + "'" + game.Name + "'"); }