コード例 #1
0
ファイル: Program.cs プロジェクト: 0x1dot/KampIntro
        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);
        }
コード例 #2
0
 public override void Add(Frisky frisky)
 {
     if (gamerCheckService.CheckIfRealPerson(frisky))
     {
         base.Add(frisky);
     }
     else
     {
         throw new Exception("Not a valid person");
     }
 }
コード例 #3
0
 public override void Update(Frisky frisky)
 {
     Console.WriteLine("'" + frisky.FirstName + " " + frisky.LastName + "'" + " Users Updated.");
 }
コード例 #4
0
 public virtual void Add(Frisky frisky)
 {
     Console.WriteLine(" " + frisky.FirstName + " user added.");
 }
コード例 #5
0
 public virtual void Update(Frisky frisky)
 {
     Console.WriteLine(frisky.FirstName + "user updated.");
 }
コード例 #6
0
 public virtual void Delete(Frisky frisky)
 {
     Console.WriteLine(frisky.FirstName + " user deleted.");
 }
コード例 #7
0
ファイル: SaleManager.cs プロジェクト: 0x1dot/KampIntro
 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");
 }
コード例 #8
0
ファイル: SaleManager.cs プロジェクト: 0x1dot/KampIntro
 public void Sale(Frisky frisky, Game game)
 {
     Console.WriteLine("'" + frisky.FirstName + " " + frisky.LastName + "'" + " purchased the game named " + "'" + game.Name + "'");
 }