Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IGamerServices gamerServices = new GamerManager(new RealIfPersonManager());

            Gamer gamer = new Gamer();

            gamer.Id            = 1;
            gamer.FirstName     = "çağrı";
            gamer.LastName      = "candan";
            gamer.BirthYear     = new DateTime(2000, 1, 11);
            gamer.NationalityId = "1234";

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


            GameSales gameSales = new GameSales();
            Campaign  campaign  = new Campaign();

            campaign.Id           = 1;
            campaign.CampaignName = "bir alana bir bedava";

            gameSales.Id       = 1;
            gameSales.GameName = "pubg";

            ICampaignServices campaignServices = new CampaignManager();
            IGameSales        gameSales1       = new GameSalesManager();

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

            gameSales1.Sale(gameSales, campaign);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            IGamerValidationService gamerValidationService = new GamerValidationManager();

            gamerValidationService.Validation(new Gamer {
                Id = 1, Name = "Tuncay", Surname = "CAN", TcNo = "55555455455", Birthday = "01.01.1998"
            });

            IGamerServices gamerServices = new GamerManager();

            gamerServices.Add(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });
            gamerServices.Delete(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });
            gamerServices.Update(new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });

            IProductService productService = new ProductManager();

            productService.Add(new Product {
                Id = 1, ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            });
            productService.Delete(new Product {
                Id = 1, ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            });
            productService.Update(new Product {
                Id = 1, ProductName = "PES19", UnitPrice = "289TL", UnitStock = "125"
            });

            IOrderService orderService = new OrderManager();

            orderService.Sale(new Order {
                Id = 1, OrderId = 1, OrderNo = "1", ProductName = "PES13", UnitPrice = "135TL", UnitStock = "352"
            },
                              new Gamer {
                Id = 2, Name = "Emirhan", Surname = "CAN", TcNo = "5558886555885", Birthday = "01.01.1997"
            });;;

            ICampaignService campaignService = new CampaignManager();

            campaignService.Add(new Campaign {
            });
            campaignService.Delete(new Campaign {
            });
            campaignService.Update(new Campaign {
            });
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerName      = "Aslıhan",
                GamerBirthDate = "27.07.2001",
                GamerTC        = "11111111111"
            };
            GamerManager gamerManager = new GamerManager();

            EDevletInfo eDevletInfo = new EDevletInfo()
            {
                TC = "11111111111"
            };

            if (eDevletInfo.TC == gamer.GamerTC)
            {
                gamerManager.Add(gamer);
            }
            else
            {
                Console.WriteLine("kullanıcı bulunamadı");
            }
            //gamerManager.Add(gamer);
            gamerManager.Update(gamer);
            gamerManager.Delete(gamer);

            Campaign campaign = new Campaign()
            {
                Id           = 1,
                CampaignName = "Yeni Yıl İndirimi"
            };
            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.Selling(gamer);
            saleManager.CampaignSelling(campaign, gamer);


            Console.ReadKey();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerId = 1, GamerName = "Sena", GamerLastname = "yesilyurt", TC = "00000000000", YearOfBirth = 1999
            };

            GamerManager gamerManager = new GamerManager(new ValidationManager());

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

            Console.WriteLine("***************************************************************");

            Game game = new Game()
            {
                GameId = 1, GameName = "xyz", GamePrice = 500
            };

            GameManager gameManager = new GameManager();

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

            Console.WriteLine("***************************************************************");

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(game, gamer);

            Console.WriteLine("***************************************************************");

            Campaign campaign = new Campaign()
            {
                CampaignId = 1, CampaignName = "sana özel", CampaignDiscountAmount = 15
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(game, gamer, campaign);
            campaignManager.Delete(game, gamer, campaign);
            campaignManager.Update(game, gamer, campaign);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            IGamer player1 = new OldGamer()
            {
                TcNo = "1", BirthYear = 1999, GamerName = "Ezgi", GamerSurname = "Akar", MembershipYear = 2
            };
            IGamer player2 = new OldGamer()
            {
                TcNo = "2", BirthYear = 1985, GamerName = "Engin", GamerSurname = "Demiroğ", MembershipYear = 20
            };
            GamerManager playerManager = new GamerManager();

            playerManager.Add(player1);
            playerManager.Add(player2);

            GameManager gameManager = new GameManager();

            gameManager.Add(new Game()
            {
                GameName = "Death Stranding", GameType = "Action", GamePrice = 499, GameReleaseYear = 2018, GameReviewScore = 8.3
            });
            gameManager.Add(new Game()
            {
                GameName = "Days Gone", GameType = "Action,Zombie", GamePrice = 139, GameReleaseYear = 2018, GameReviewScore = 7.3
            });
            gameManager.Add(new Game()
            {
                GameName = "Persona 5", GameType = "JRPG", GamePrice = 99, GameReleaseYear = 2015, GameReviewScore = 9.1
            });
            gameManager.Add(new Game()
            {
                GameName = "Cyberpunk 2077", GameType = "RPG", GamePrice = 499, GameReleaseYear = 2020, GameReviewScore = 7.1
            });
            gameManager.Add(new Game()
            {
                GameName = "Witcher 3", GameType = "RPG", GamePrice = 49, GameReleaseYear = 2015, GameReviewScore = 9.3
            });

            while (true)
            {
                Console.WriteLine("**********MENU**********");
                Console.WriteLine("1-)Oyuncu Ekle\n2-)Oyuncu Sil\n3-)Kullanıcıları Listele\n4-)Oyun Ekle\n5-)Oyun Sil\n6-)Oyunları Listele\n7-)Oyunları İnceleme Puanına Göre Listele\n8-)Oyunları Çıkış Yıllarına Göre Sırala\n9-)Kampanya Seçiniz\n10-)Çıkış");
                Console.WriteLine("************************");
                int choice = Convert.ToInt32(Console.ReadLine());
                Console.Clear();

                if (choice == 1)
                {
                    Console.WriteLine("Eklemek istediğiniz kullanıcı bilgilerini giriniz");
                    Console.WriteLine("Tc no:");
                    string TcNo = Console.ReadLine();
                    Console.WriteLine("Ad:");
                    string PlayerName = Console.ReadLine();
                    Console.WriteLine("Soyad:");
                    string PlayerSurname = Console.ReadLine();
                    Console.WriteLine("Doğum Yılı:");
                    int BirthYear = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Kaç yıl kullanmayı taahhüt ediyorsunuz:");
                    int UndertakingYear = Convert.ToInt32(Console.ReadLine());

                    playerManager.Add(new NewGamer()
                    {
                        TcNo = TcNo, GamerName = PlayerName, GamerSurname = PlayerSurname, BirthYear = BirthYear, UndertakingYear = UndertakingYear
                    });
                }

                else if (choice == 2)
                {
                    Console.WriteLine("Silmek istediğiniz oyuncunun Tc Numarasını giriniz:");
                    playerManager.Delete(Console.ReadLine());
                }

                else if (choice == 3)
                {
                    playerManager.ListPlayer();
                }

                else if (choice == 4)
                {
                    Console.WriteLine("Eklemek istediğiniz oyunun bilgilerini giriniz");
                    Console.WriteLine("Oyun Adı:");
                    string GameName = Console.ReadLine();
                    Console.WriteLine("Oyunun Çıkış Yılı:");
                    int GameReleaseYear = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Oyunun Türü:");
                    string GameType = Console.ReadLine();
                    Console.WriteLine("Oyunun Fiyatı:");
                    double GamePrice = Convert.ToDouble(Console.ReadLine());
                    Console.WriteLine("Oyunun İnceleme Puanı:");
                    double GameReviewScore = Convert.ToDouble(Console.ReadLine());

                    gameManager.Add(new Game()
                    {
                        GameName = GameName, GameReleaseYear = GameReleaseYear, GameType = GameType, GamePrice = GamePrice, GameReviewScore = GameReviewScore
                    });
                }

                else if (choice == 5)
                {
                    Console.WriteLine("Silmek istediğiniz oyunun Adını giriniz:");
                    gameManager.Delete(Console.ReadLine());
                }

                else if (choice == 6)
                {
                    gameManager.ListGame();
                }

                else if (choice == 7)
                {
                    gameManager.SortByReviewScores();
                }
                else if (choice == 8)
                {
                    gameManager.SortByReleaseYear();
                }
                else if (choice == 9)
                {
                    while (true)
                    {
                        Console.WriteLine("**********KAMPANYALAR**********");
                        Console.WriteLine("-1-Öğrenci Kampanyası\n-2-Kara Cuma Kampanyası\n-3-Ana Menüye Dön");
                        Console.WriteLine("*******************************");

                        int choice2 = Convert.ToInt32(Console.ReadLine());
                        Console.Clear();

                        if (choice2 == 1)
                        {
                            gameManager.ListGame();
                            Console.WriteLine("Yukarıdaki oyunlardan öğrencisi kampanyası uygulamak istediğiniz oyunun adını yazınız:");
                            string name = Console.ReadLine();
                            Console.Clear();
                            ICampaignService campaign = new StudentCampaign();
                            gameManager.GetGame(name, campaign);
                        }
                        else if (choice2 == 2)
                        {
                            gameManager.ListGame();
                            Console.WriteLine("Yukarıdaki oyunlardan kara cuma kampanyası uygulamak istediğiniz oyunun adını yazınız:");
                            string name = Console.ReadLine();
                            Console.Clear();
                            ICampaignService campaign = new BlackFridayCampaign();
                            gameManager.GetGame(name, campaign);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    Console.WriteLine("Programdan çıkış yaptınız.\nİyi günler...");
                    break;
                }
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();

            gamer1.Name        = "Emre";
            gamer1.LastName    = "Aydın";
            gamer1.TCNo        = "1234567890";
            gamer1.DateOfBirth = 2002;
            gamer1.GamerId     = 1;

            Gamer gamer2 = new Gamer();

            gamer2.Name        = "Ahmet";
            gamer2.LastName    = "Keleş";
            gamer2.TCNo        = "3216549870";
            gamer2.DateOfBirth = 2007;
            gamer2.GamerId     = 2;

            Gamer gamer3 = new Gamer();

            gamer3.Name        = "Yunus";
            gamer3.LastName    = "Öz";
            gamer3.TCNo        = "543219876";
            gamer3.DateOfBirth = 1995;
            gamer3.GamerId     = 3;

            Games games1 = new Games();

            games1.GameId    = 1;
            games1.GameName  = "PUBG";
            games1.GamePrice = 50;

            Games games2 = new Games();

            games2.GameId    = 2;
            games2.GameName  = "Counter Strike Global Offensive";
            games2.GamePrice = 40;

            Games games3 = new Games();

            games3.GameId    = 3;
            games3.GameName  = "Cyberpunk 2077";
            games3.GamePrice = 250;



            GamerManager gamerManager = new GamerManager();

            gamerManager.Add(new Gamer {
                GamerId = 4, Name = "Emir", LastName = "Aras", TCNo = "456789123", DateOfBirth = 2017
            });
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);

            GameManager gameManager = new GameManager();

            gameManager.Add(new Games {
                GameId = 4, GameName = "League Of Legends", GamePrice = 20
            });
            gameManager.Update(games1);
            gameManager.Delete(games1);


            SummerSale summerSale = new SummerSale();

            summerSale.DıscountForGame(games1);

            WinterSale winterSale = new WinterSale();

            winterSale.DıscountForGame(games2);

            SummerSale summerSale1 = new SummerSale();

            summerSale.FınıshtoDiscount(games3);

            DıscountManager dıscountManager = new DıscountManager();

            dıscountManager.Dıscount(games1, gamer1);

            Campaign campaign1 = new Campaign();

            campaign1.CampaignName       = "Black Friday";
            campaign1.CampaignId         = 1;
            campaign1.CampaignPercentage = 25;

            DıscountManager dıscountManager1 = new DıscountManager();

            dıscountManager1.Add(campaign1);
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            //Oyuncu Ekleme
            IGamerService      gamerService      = new GamerManager(new GamerCheckManager());
            IGamerCheckService gamerCheckService = new GamerCheckManager();
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                FirstName     = "Melike",
                LastName      = "Işık",
                BirthYear     = 1996,
                NationalityId = "12345678910"
            };
            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                FirstName     = "Müge",
                LastName      = "Işık",
                BirthYear     = 2000,
                NationalityId = "12345678910"
            };

            gamerService.Add(gamer1);
            gamerService.Add(gamer2);


            gamerService.Delete(gamer1);  //Oyuncu Silme
            gamer2.FirstName = "Nimet Müge";
            gamerService.Update(gamer2);

            IGameService gameService = new GameManager();
            Game         game1       = new Game()
            {
                Id          = 1,
                Name        = "Grand Theft Auto 5",
                Price       = 152.10,
                Detail      = "Grand Theft Auto serisinin beşinci oyunudur. Tüm GTAV hikayesi, GTA Online ve mevcut içerik ve yükseltmelerin tümünün yanı sıra GTA Online’da kendi suç imparatorluğunu kurmanın en kısa yolu Criminal Enterprise Başlangıç Paketi de bulunuyor.",
                UnitInStock = 1,
            };

            Game game2 = new Game()
            {
                Id          = 2,
                Name        = "The Sims 4",
                Price       = 265,
                Detail      = "The Sims 4, serinin önceki oyunları gibi yaşam simülasyonu oyunudur. Oyuncular bir Sim karakteri yaratırlar ve oyunda farklı Sim kişiliklerini keşfederek oyuna yön verirler. Simler daha önceki oyunlardan farklı olarak aynı anda iki fiziksel eylemi gerçekleştirebilir. Ayrıca Simlerin modları da oyun akışını değiştirebilir. Örneğin kızgın ya da heyecanlı bir Sim, verilen bir görevi daha hızlı yapar.",
                UnitInStock = 2,
            };

            //Kampanya ekleme

            ICompaignService compaignService = new CompaignManager();
            Compaign         compaign1       = new Compaign()
            {
                Id       = 1,
                Name     = "Black Friday Compaign",
                Discount = 10,
            };

            Compaign compaign2 = new Compaign()
            {
                Id       = 2,
                Name     = "Happy New Year Compaign",
                Discount = 20,
            };

            compaignService.Add(compaign1);
            compaignService.Add(compaign2);

            gameService.ApplyCompaign(compaign1, game1);
            gameService.ApplyCompaign(compaign1, game2);

            gameService.SellGame(game1, gamer2);
            gameService.SellGame(game2, gamer2);
            gameService.SellGame(game1, gamer1);
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            //Oyuncular
            Gamer gamer1 = new Gamer();

            gamer1.GamerId       = 1;
            gamer1.FirstName     = "merve";
            gamer1.LastName      = "aydın";
            gamer1.NationalityId = "12345";
            gamer1.DateOfBirth   = new DateTime(1992, 10, 10);

            Gamer gamer2 = new Gamer();

            gamer2.GamerId       = 2;
            gamer2.FirstName     = "ferhat";
            gamer2.LastName      = "aydın";
            gamer2.NationalityId = "123456";
            gamer2.DateOfBirth   = new DateTime(1985, 2, 1);

            Gamer gamer3 = new Gamer();

            gamer3.GamerId       = 3;
            gamer3.FirstName     = "esra";
            gamer3.LastName      = "aydın";
            gamer3.NationalityId = "1234567";
            gamer3.DateOfBirth   = new DateTime(1995, 1, 1);


            //Kampanyalar
            Campaign campaign1 = new Campaign();

            campaign1.CampaignId    = 10;
            campaign1.CampaignName  = "kış ";
            campaign1.CampaignValue = "%5";

            Campaign campaign2 = new Campaign();

            campaign2.CampaignId    = 11;
            campaign2.CampaignName  = "tatil  ";
            campaign2.CampaignValue = "%10";

            Campaign campaign3 = new Campaign();

            campaign3.CampaignId    = 12;
            campaign3.CampaignName  = "yaz ";
            campaign3.CampaignValue = "%15";

            //Oyunlar

            Game game1 = new Game();

            game1.GameId    = 5;
            game1.GameName  = "tetris";
            game1.GamePrice = 100.0;

            IGamerService gamerService = new GamerManager(new GamerCheckManager());

            gamerService.Save(gamer1);
            gamerService.Update(gamer2);
            gamerService.Delete(gamer3);

            Console.WriteLine("----------------------------");

            ICampaignService campaignService = new CampaignService();

            campaignService.Add(campaign3);
            campaignService.Delete(campaign2);
            campaignService.Update(campaign1);

            Console.WriteLine("----------------------------");

            IGameSellService gameSellService = new GameManager();

            gameSellService.Sell(gamer2, game1, campaign2);
        }