Пример #1
0
        static void Main(string[] args)
        {
            GamerManager    gamerManager    = new GamerManager(new NewEStateValidationManager());
            SalesManager    salesManager    = new SalesManager();
            CampaignManager campaignManager = new CampaignManager();

            Gamer gamer = new Gamer()
            {
                Id             = 1,
                BirthYear      = 1995,
                FirstName      = "Sonnur",
                LastName       = "TAYFUROĞLU",
                IdentityNumber = 123456
            };

            Gamer gamer2 = new Gamer()
            {
                Id             = 2,
                BirthYear      = 1991,
                FirstName      = "Merve",
                LastName       = "Çakmak",
                IdentityNumber = 987456
            };

            Sales sales1 = new Sales();

            sales1.SalesId  = 1;
            sales1.GameName = "PUBG";
            sales1.Price    = 149.90;

            Sales sales2 = new Sales();

            sales2.SalesId  = 2;
            sales2.GameName = "GOT:Conquest";
            sales2.Price    = 399.99;

            Campaign campaign1 = new Campaign();

            campaign1.CampaignName    = "Yeni yıl kampanyası ";
            campaign1.CampaignPercent = 50;

            gamerManager.Delete(gamer);
            gamerManager.Update(gamer);

            Console.WriteLine("                                         ");
            salesManager.Sales(sales2, gamer);
            salesManager.Sales(sales1, gamer2);

            Console.WriteLine("                                          ");
            campaignManager.Add(campaign1, gamer, sales2);
            Console.WriteLine("                                           ");
            campaignManager.Add(campaign1, gamer2, sales1);

            Console.WriteLine("                                            ");
            campaignManager.Delete(campaign1, gamer2, sales1);

            campaignManager.Update(campaign1, gamer2, sales2);
        }
Пример #2
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new NewEStateUserValidationManager());

            gamerManager.Add(new Gamer
            {
                Id             = 1,
                BirthYear      = 2001,
                FirstName      = "ENES",
                LastName       = "Ceylan",
                IdentityNumber = 12345
            }
                             );
            Console.WriteLine("****************************************************");

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                CampaingId     = 1,
                CampaignName   = "If you buy this product second product 50% off",
                CampaingDetail = "The campaign will end at the end of July 2021."
            });
            Console.WriteLine("****************************************************");

            OrderManager orderManager = new OrderManager();

            orderManager.MakeSale(new Products
            {
                ProductId   = 1,
                ProductName = "E-Run",
                UnitPrice   = 100,
                Stock       = 250
            });
        }
Пример #3
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

            gamer.Id            = 1;
            gamer.FirstName     = "Görkem";
            gamer.LastName      = "Aran";
            gamer.NationalityId = "01234567890";
            gamer.BirthDate     = "1999";

            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(gamer);
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            Campaign campaign = new Campaign();

            campaign.Id             = 1;
            campaign.CampaignName   = "İlk sipariş";
            campaign.CampaignDetail = "İlk siparişte %35 indirim ";

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Update(campaign);
            campaignManager.Delete(campaign);

            Order order = new Order();

            order.Id        = 1;
            order.OrderName = "A oyunu satın alımı";

            OrderManager orderManager = new OrderManager();

            orderManager.Add(gamer, order, campaign);
            orderManager.Update(gamer, order);
            orderManager.Cancel(gamer, order);
        }