示例#1
0
        static void Main(string[] args)
        {
            Player player1 = new Player
            {
                Id        = 1,
                FirstName = "Afet",
                LastName  = "Agayeva",
                DateTime  = new DateTime(2003, 1, 6)
            };
            Game game1 = new Game
            {
                Id       = 1,
                GameName = "Pubg",
                Price    = 100
            };
            Campaign campaign1 = new Campaign
            {
                Id           = 1,
                CampaignName = "Discount campaign",
                Percent      = 10
            };
            SellingManager sellingManager = new SellingManager();

            sellingManager.Buy(player1, game1, campaign1);

            PlayerManager playerManager = new PlayerManager();

            playerManager.Add(player1);

            AuthManager authManager = new AuthManager(new CheckManager());

            authManager.Register();
        }
示例#2
0
        static void Main(string[] args)
        {
            Player player1 = new Player();

            player1.Id            = 1;
            player1.NationalityId = "********";
            player1.FirstName     = "Alierk";
            player1.LastName      = "Küçük";
            player1.BirthDate     = new DateTime(1986, 03, 05);
            player1.PlayerName    = "meSSiaS";
            player1.Money         = 150;

            Item item1 = new Item();

            item1.ItemName  = "Armor";
            item1.ItemPrice = 100;



            SellingManager sellingManager = new SellingManager();
            PlayerManager  playerManager  = new PlayerManager(new MernisServiceAdapter());

            playerManager.Save(player1);
            //playerManager.Update("MESSIAS", player1);
            //playerManager.Delete(player1);
            sellingManager.Buy(item1, player1);
            sellingManager.Sell(item1, player1);
            BaseDiscountManager discountManager = new DiscountManager();

            discountManager.MakeDiscount(0.50, item1);
            BaseDiscountManager discountManager1 = new BirthDayDiscountManager(player1, new DiscountAdapter());

            discountManager1.MakeDiscount(0.75, item1);
            sellingManager.Buy(item1, player1);
            ItemDiscount itemDiscount = new ItemDiscount();

            itemDiscount.DiscountName = "Yeni Yıl";
            itemDiscount.DiscountRate = 0.75;
            itemDiscount.item         = item1;
            BaseDiscountManager itemDiscountManager = new ItemDiscountManager();

            itemDiscountManager.MakeDiscount(itemDiscount.DiscountRate, itemDiscount.item);
        }