static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer        oyuncu       = new Gamer()
            {
                FirstName   = "Gökhan",
                TcId        = "15453713426",
                DateOfBirth = new DateTime(1999, 02, 18),
                LastName    = "Güney",
                Id          = 1
            };

            gamerManager.Add(oyuncu);
            gamerManager.Remove(oyuncu);
            gamerManager.Update(oyuncu);

            Game oyun = new Game()
            {
                Id = 1, Name = "Wild Rift", Description = "Brand new mobile vers" +
                                                          "ion of League of Legends, you can enjoy the rift on your cellular with this one.", Price = 100
            };
            GameManager gameManager = new GameManager();

            gameManager.Add(oyun);
            gameManager.Update(oyun);
            gameManager.Delete(oyun);

            Campaign kampanya = new Campaign()
            {
                Id = 1, Discount = 70, Name = "Daft Punk Discount"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(kampanya);
            campaignManager.Edit(kampanya);
            campaignManager.Delete(kampanya);

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(oyuncu, oyun);
            salesManager.SellWithDiscount(oyuncu, oyun, kampanya);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //GamerManager gamerManager = new GamerManager(new NewEStateUserValidationManager());
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                Id = 1, BirthYear = 1992, FirstName = "Aykut", LastName = "Öztürk", IdentityNumber = 12345
            });

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign {
                CampaignName = "4 al 3 öde", CampaignStart = "10.04.2021", CampaignFinish = "10.05.2021"
            };

            SalesManager salesManager = new SalesManager();
            Sales        sales        = new Sales {
                SalesPrice = 300, SalesAmount = 10
            };

            salesManager.Sell(sales, campaign);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            gamerManager.Add(new Gamer
            {
                BirthDate         = new DateTime(1989, 7, 31),
                Name              = "a",
                LastName          = "b",
                NationalityNumber = "1234"
            });

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                Id       = 2,
                Name     = "İndirim",
                Discount = 10
            });

            GameManager gameManager = new GameManager();

            gameManager.Add(new Game
            {
                Id    = 1,
                Name  = "a",
                Price = 15
            });

            SaleManager salesManager = new SaleManager();

            salesManager.Add(new Gamer {
                Name = "a"
            }, new Game {
                Name = "b"
            }, new Campaign {
                Name = "İndirim"
            });
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please Read The Instructions");
            Console.WriteLine("If you want to select player operations press 1 \n  If you want to add campaign press 2 \n If you want to go order operations press 3");

            Console.WriteLine("Please enter the operation number");
            int operationNumber = Convert.ToInt32(Console.ReadLine());

            switch (operationNumber)
            {
            case 1:
                //CASE1

                Console.WriteLine("----------------Welcome to the  create, update and delete operation related to players---------------------------");
                PlayerInfo player = new PlayerInfo();

                Console.WriteLine("Please enter your Name : ");
                player.Name = Console.ReadLine();

                Console.WriteLine("Please enter your Surname : ");
                player.Surname = Console.ReadLine();

                Console.WriteLine("Your Username is : " + player.Username);

                PlayerManager playerManager = new PlayerManager();
                playerManager.UpdatePlayer(player);
                playerManager.DeletePlayer(player);
                playerManager.RegisterPlayer(player);

                break;

            //CASE2
            case 2:
                Console.WriteLine("------------------ Welcome To The Campaign Screen---------------------");

                Campaign        campaign        = new Campaign();
                CampaignManager campaignManager = new CampaignManager();
                int             wantedNumber;
                int             section = 1;
                Console.WriteLine("If you want to just add campaign name please enter 0 ");
                wantedNumber = Convert.ToInt32(Console.ReadLine());
                if (wantedNumber == 0)
                {
                    Console.WriteLine("Please Enter Campaign Name ");
                    campaign.CampaignName = Console.ReadLine();
                    section++;
                }
                else
                {
                    Console.WriteLine("Please Enter Campaign Name ");
                    campaign.CampaignName = Console.ReadLine();

                    Console.WriteLine("Please Enter Campaign ID ");
                    campaign.CampaignId = Convert.ToInt32(Console.ReadLine());

                    Console.WriteLine("Please enter how long the campaign will last. ");
                    campaign.CampaignLong = Convert.ToInt32(Console.ReadLine());


                    section--;
                }

                if (section == 2)
                {
                    campaignManager.AddCampaign(campaign);
                    campaignManager.DeleteCampaign(campaign);
                    campaignManager.UpdateCampaign(campaign);
                }
                else if (section == 0)
                {
                    Console.WriteLine("Your Campaign Name : " + campaign.CampaignName + "       " + " Your Campaign ID : " + campaign.CampaignId + "     " + "Your Campaign Long : " + campaign.CampaignLong);
                    campaignManager.AddCampaign(campaign);
                    campaignManager.DeleteCampaign(campaign);
                    campaignManager.UpdateCampaign(campaign);
                }

                break;

            case 3:
                //CASE3
                Console.WriteLine("----------------Welcome To  Order Screen-------------------");

                Order order = new Order();

                Console.WriteLine("Please Enter Game Name :");
                order.gameName = Console.ReadLine();

                Console.WriteLine("Please Enter Game Price ");
                order.gamePrice = Convert.ToInt32(Console.ReadLine());

                OrderManager orderManager = new OrderManager();
                orderManager.AddGame(order);
                orderManager.AddPrice(order);

                break;
            }
        }