コード例 #1
0
        private static void TestValuesMethod()
        {
            admin.Admins = new List <Person>();
            Person adminPerson = new Person {
                Id = 1, Username = "******", Password = "******", FirstName = "FIRAT", LastName = "DURSUN", DateOfBirth = Convert.ToDateTime("1995.01.01"), NationalityId = 12345678911
            };

            if (new PersonValidationManager().TrueValidate(adminPerson))
            {
                admin.Admins.Add(adminPerson);
            }
            else
            {
                Console.WriteLine("Admin eklenirken hata oluştu");
            }
            Person person2 = new Person {
                Id = 2, Username = "******", Password = "******", FirstName = "deneme1", LastName = "deneme1soyisim", DateOfBirth = Convert.ToDateTime("2000.01.01"), NationalityId = 12345678901
            };
            Person person3 = new Person {
                Id = 3, Username = "******", Password = "******", FirstName = "deneme2", LastName = "deneme2soyisim", DateOfBirth = Convert.ToDateTime("2001.01.01"), NationalityId = 11111111111
            };

            gamerManager.Add(person2);
            gamerManager.Add(person3);
            gamerManager.Delete(person3);
            gamerManager.GetListWrite();
            Game gta = new Game
            {
                Id        = gameId,
                GameName  = "Grand Theft Auto V",
                GamePrice = 250
            };

            gameManager.Add(gta);
            gameId++;
            gameManager.Add(new Game {
                Id = gameId, GameName = "Witcher 3", GamePrice = 50
            });
            gameId++;
            gameManager.GetListWrite();
            Campaign campaign1 = new Campaign {
                Id = campaignId, CampaignName = "Kış kampanyası", Discount = 20, StartDate = DateTime.Now, EndDate = Convert.ToDateTime("20.02.2021")
            };

            campaignManager.Add(campaign1);
            campaignId++;
            campaignManager.Add(new Campaign {
                Id = campaignId, CampaignName = "Yaz kampanyası", Discount = 25, StartDate = Convert.ToDateTime("20.06.2020"), EndDate = Convert.ToDateTime("20.08.2020")
            });
            campaignId++;
            campaignManager.GetListWrite();
            gameManager.Buy(gta, person2, campaign1);
            Console.WriteLine("Test Değerleri Sonu\n");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: hashus12/GameSample
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

            gamer.FirstName = "Engin";
            gamer.LastName  = "Demiroğ";
            gamer.TcNo      = "1248461321655";
            gamer.BirthDay  = 1990;

            GamerManager gamerManager = new GamerManager();

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

            BlackFridayCompaign blackFridayCampaign = new BlackFridayCompaign();

            blackFridayCampaign.Id           = 1;
            blackFridayCampaign.CompaignName = "blackfriday";
            blackFridayCampaign.Discount     = "%20";

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Save(blackFridayCampaign);
            campaignManager.Update(blackFridayCampaign);
            campaignManager.Delete(blackFridayCampaign);

            SellManager sellManager = new SellManager();

            sellManager.SellingGames(gamer);
            sellManager.SellingCampaign(blackFridayCampaign);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: tugcesekban/GamePro
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer        gamer        = new Gamer {
                Id = 1, FirstName = "Berna", Surname = "Akın", NationalId = "1111111111111", DateOfBirth = new DateTime(1991, 1, 1)
            };

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

            Game game = new Game {
                Id = 2, Name = "GoodGame", Description = "It's so awesome", Price = 200
            };
            GameManager gameManager = new GameManager();

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

            Campaign campaign = new Campaign {
                Id = 3, Name = "Big Sale", Discount = 10
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Delete(campaign);
            campaignManager.Update(campaign);
        }
コード例 #4
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new InMemoryGamerDal());

            gamerManager.Delete(125);

            gamerManager.Update(new Gamer
            {
                Id             = 124,
                FirstName      = "Yağmur",
                LastName       = "-",
                BirthYear      = 1997,
                IdentityNumber = 123123222
            });

            gamerManager.Add(new Gamer
            {
                Id             = 126,
                FirstName      = "Şevval",
                LastName       = "-",
                BirthYear      = 1999,
                IdentityNumber = 122112344
            });

            foreach (var gamer in gamerManager.GetAll())
            {
                Console.WriteLine(gamer.FirstName);
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: fatihkabakk/GameDev
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer {
                UserId = 1, Name = "Fatih", LastName = "Kabak", NationalityId = "12345678910", YearOfBirth = 1999
            };
            Gamer gamer2 = new Gamer {
                UserId = 2, Name = "Ekrem", LastName = "Sönmez", NationalityId = "11111111110", YearOfBirth = 1992
            };
            Gamer gamer3 = new Gamer {
                UserId = 3, Name = "A", LastName = "", NationalityId = "123", YearOfBirth = 2010
            };
            Gamer gamer4 = new Gamer {
                UserId = 4, Name = "Özgür", LastName = "Ağca", NationalityId = "13445367890", YearOfBirth = 2001
            };

            Game gtav = new Game {
                GameId = 1, Name = "GTA-V", Developer = "Rockstar Games", ReleaseDate = "17 Eylül 2013", UnitPrice = 156
            };
            Game pubg = new Game {
                GameId = 2, Name = "PUBG", Developer = "KRAFTON, Inc.", ReleaseDate = "21 Aralık 2017", UnitPrice = 87
            };

            Console.WriteLine("*********************************************");
            IGamerDal          gamerDal          = new InMemoryGamerDal();
            IValidationService validationService = new MernisManager();

            GamerManager gamerManager = new GamerManager(gamerDal, validationService);

            gamerManager.Add(gamer1);
            gamerManager.Add(gamer2);
            gamerManager.Add(gamer3);
            gamerManager.Add(gamer4);
            gamerManager.Delete(gamer2);
            Console.WriteLine("*********************************************");

            Console.WriteLine("\n*********************************************");
            IGameDal         gameDal         = new InMemoryGameDal();
            ICampaignService campaignService = new CampaignManager();

            GameManager gameManager = new GameManager(gameDal);

            gameManager.Add(gtav);
            gameManager.Add(pubg);

            OrderManager orderManager = new OrderManager(campaignService);

            orderManager.CreateCampaignOrder(gamer1, gtav, new Campaign {
                Name = "Hot Sales!", DiscountRate = 25
            });
            orderManager.CreateCampaignOrder(gamer4, pubg, new Campaign {
                Name = "Winter Sales!", DiscountRate = 50
            });
            orderManager.CreateOrder(gamer1, pubg);

            Console.WriteLine("*********************************************");
            Console.ReadKey();
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: CagriKibar/GameBackendDemo
        static void Main(string[] args)
        {
            GameManager  gameManager  = new GameManager();
            GamerManager gamerManager = new GamerManager(new UserControlManager());


            gamerManager.Add(new Gamer
            {
                GamerId        = 1,
                FirstName      = "Çağrı",
                LastName       = "Kibar",
                IdentityNumber = "123456789"
            });
            gamerManager.Update(new Gamer
            {
                GamerId        = 1,
                FirstName      = "Çağrı",
                LastName       = "Kibar",
                IdentityNumber = "123456789"
            });
            gamerManager.Delete(new Gamer
            {
                GamerId        = 1,
                FirstName      = "Çağrı",
                LastName       = "Kibar",
                IdentityNumber = "123456789"
            });

            gameManager.GameBuy(new Gamer
            {
                GamerId        = 1,
                FirstName      = "Çağrı",
                LastName       = "Kibar",
                IdentityNumber = "123456789"
            }, new Game
            {
                GameId    = 1,
                GameName  = "Battlefield 4",
                GamePrice = 150
            }, new Campaign
            {
                CampaignId   = 1,
                CampaignName = "%50 İndirim",
                Description  = "Promo kodu sayesinde indirim kazanırsınız"
            });
        }
コード例 #7
0
        static void Main(string[] args)
        {
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer            gamer        = new Gamer {
                DateOfBirth = new DateTime(2000, 2, 14), FirstName = "Elif", LastName = "Karagöz", NatioanalityId = "43597864310"
            };

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

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

            GameManager gameManager = new GameManager();
            Game        game        = new Game {
                GameName = "Cyberpunk", GamePrice = "325"
            };

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

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

            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign        = new Campaign {
                CampaignName = "Bayram Kampanyası", CampaignRate = "%50"
            };

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

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

            SaleManager saleManager = new SaleManager();

            saleManager.NormalSale(game, gamer);
            saleManager.CampaignSale(game, gamer, campaign);

            Console.ReadLine();
        }
コード例 #8
0
        static void Main(string[] args)
        {
            GamerManager gamerManager1 = new GamerManager(new GamerValidationManager());
            Gamer        gamer1        = new Gamer()
            {
                GamerId = 1, GamerFirstName = "Delal", GamerLastName = "Karakuş", DateofBirth = 1995, NationalityId = "123456"
            };

            GamerManager gamerManager2 = new GamerManager(new GamerValidationManager());
            Gamer        gamer2        = new Gamer()
            {
                GamerId = 2, GamerFirstName = "Murat", GamerLastName = "Altınok", DateofBirth = 1992, NationalityId = "522481"
            };

            GamerManager gamerManager = new GamerManager(new GamerValidationManager());

            gamerManager.Add(gamer1);
            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);
            gamerManager.Add(gamer2);
            gamerManager.Update(gamer2);
            gamerManager.Delete(gamer2);

            Game game1 = new Game()
            {
                GameId = 1, GameName = "Dead by Daylight", GamePrice = 200
            };
            Game game2 = new Game()
            {
                GameId = 2, GameName = "Life is Satrange", GamePrice = 150
            };
            Game game3 = new Game()
            {
                GameId = 3, GameName = "Shadow of War", GamePrice = 300
            };

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);
            gameManager.Update(game1);
            gameManager.Delete(game1);
            gameManager.Add(game2);
            gameManager.Update(game2);
            gameManager.Delete(game2);
            gameManager.Add(game3);
            gameManager.Update(game3);
            gameManager.Delete(game3);

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 1, CampaignName = "Yılbaşı Kampanyası", DiscountRate = 25
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Yaz Kampanyası", DiscountRate = 15
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1);
            campaignManager.Add(campaign2);
            campaignManager.Update(campaign1);
            campaignManager.Update(campaign2);
            campaignManager.Delete(campaign1);
            campaignManager.Delete(campaign2);

            SalesManager salesManager = new SalesManager();

            salesManager.Sales(game1, gamer2);
            salesManager.CampaignSales(game3, gamer1, campaign2);

            SalesManager salesmanager = new SalesManager();

            salesManager.Sales(game1, gamer1);
            salesManager.Sales(game2, gamer2);
            salesManager.CampaignSales(game3, gamer2, campaign1);
            salesManager.CampaignSales(game2, gamer1, campaign2);
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: m-oguz/SellingGames
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                GameID = 1, GameName = "Counter Strike", GamePrice = 133.00
            };
            Game game2 = new Game()
            {
                GameID = 2, GameName = "PUBG Mobile ", GamePrice = 123.40
            };
            Game game3 = new Game()
            {
                GameID = 3, GameName = "Need for Speed", GamePrice = 175.90
            };
            Game game4 = new Game()
            {
                GameID = 4, GameName = "Medal of Honor", GamePrice = 92.00
            };
            Game game5 = new Game()
            {
                GameID = 5, GameName = "Call of Duty", GamePrice = 124.60
            };
            Game game6 = new Game()
            {
                GameID = 6, GameName = "Angry Birds", GamePrice = 210.30
            };

            Gamer gamer1 = new Gamer()
            {
                Id = 1, FirstName = "Bledar", LastName = "Brown", DateOfBirth = new DateTime(1987, 2, 6), NationalIdNo = "353434534764"
            };
            Gamer gamer2 = new Gamer()
            {
                Id = 2, FirstName = "Rachid", LastName = "Khane", DateOfBirth = new DateTime(1992, 10, 30), NationalIdNo = "8765432345"
            };
            Gamer gamer3 = new Gamer()
            {
                Id = 3, FirstName = "Naoko", LastName = "Kohosi", DateOfBirth = new DateTime(2000, 3, 12), NationalIdNo = "121300787264"
            };
            Gamer gamer4 = new Gamer()
            {
                Id = 4, FirstName = "Natalia", LastName = "Jaros", DateOfBirth = new DateTime(2003, 6, 12), NationalIdNo = "123471928461"
            };
            Gamer gamer5 = new Gamer()
            {
                Id = 5, FirstName = "Lisa", LastName = "Jonie", DateOfBirth = new DateTime(1997, 1, 12), NationalIdNo = "2179176412"
            };
            Gamer gamer6 = new Gamer()
            {
                Id = 6, FirstName = "Jenny", LastName = "Kirks", DateOfBirth = new DateTime(2005, 12, 12), NationalIdNo = "641294169421"
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 1, CampaignName = "Welcome", DiscountAmount = 25, ExpiryDate = new DateTime(2025, 4, 12)
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Summer", DiscountAmount = 20, ExpiryDate = new DateTime(2025, 11, 11)
            };
            Campaign campaign3 = new Campaign()
            {
                CampaignId = 3, CampaignName = "VIP", DiscountAmount = 10, ExpiryDate = new DateTime(2025, 5, 4)
            };
            Campaign campaign4 = new Campaign()
            {
                CampaignId = 4, CampaignName = "Our Gift", DiscountAmount = 5, ExpiryDate = new DateTime(2025, 12, 10)
            };
            Campaign campaign5 = new Campaign()
            {
                CampaignId = 5, CampaignName = "Valentine's", DiscountAmount = 50, ExpiryDate = new DateTime(2025, 5, 5)
            };
            Campaign campaign6 = new Campaign()
            {
                CampaignId = 6, CampaignName = "Unnamed", DiscountAmount = 2, ExpiryDate = new DateTime(2023, 10, 18)
            };


            GameManager gameManager = new GameManager();

            gameManager.AddGame(game1);
            gameManager.AddGame(game2);
            gameManager.AddGame(game3);
            gameManager.AddGame(game4);
            gameManager.AddGame(game5);
            gameManager.AddGame(game6);
            gameManager.DeleteGame(game5);
            gameManager.UpdateGame(game4, 230.00);

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


            GamerManager gamerManager = new GamerManager();

            gamerManager.Register(gamer1);
            gamerManager.Register(gamer2);
            gamerManager.Register(gamer3);
            gamerManager.Register(gamer4);
            gamerManager.Register(gamer5);
            gamerManager.Register(gamer6);
            gamerManager.Delete(gamer3);
            gamerManager.Update(gamer5);

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


            CampaignManager campaignManager = new CampaignManager();

            campaignManager.AddCampaign(campaign1);
            campaignManager.AddCampaign(campaign2);
            campaignManager.AddCampaign(campaign3);
            campaignManager.AddCampaign(campaign4);
            campaignManager.AddCampaign(campaign5);
            campaignManager.AddCampaign(campaign6);

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

            gameManager.ListTheGames();
            gamerManager.ListTheGamers();
            campaignManager.ListTheCampaigns();


            SalesManager salesManager = new SalesManager();

            salesManager.Sell(gamer6, game2);
            salesManager.Sell(gamer2, game3, campaign1);
            salesManager.Sell(gamer1, game4, campaign1);
            salesManager.Sell(gamer4, game6, campaign5);
            salesManager.Sell(gamer5, game1);
            salesManager.Sell(gamer1, game2);
            salesManager.Sell(gamer4, game3, campaign3);
            salesManager.Sell(gamer5, game4);
            salesManager.Sell(gamer1, game6, campaign2);
            salesManager.Sell(gamer2, game1, campaign4);
            salesManager.Sell(gamer5, game2);

            campaignManager.Modify(campaign1, new DateTime(2021, 10, 30));
            campaignManager.Modify(campaign2, new DateTime(2021, 10, 30));
            campaignManager.Modify(campaign3, new DateTime(2021, 10, 30));
            campaignManager.Modify(campaign4, new DateTime(2021, 10, 30));
            campaignManager.Modify(campaign5, new DateTime(2021, 10, 30));

            campaignManager.Modify(campaign2, 80);
            campaignManager.Modify(campaign5, 70);


            salesManager.Sell(gamer6, game3, campaign1);
            salesManager.Sell(gamer2, game4, campaign2);
            salesManager.Sell(gamer4, game6, campaign5);
            salesManager.Sell(gamer6, game1, campaign2);
            salesManager.Sell(gamer1, game2, campaign1);

            campaignManager.DeleteCampaign(campaign6);

            campaignManager.ListTheCampaigns();
            gameManager.ListTheGames();



            Console.Read();
        }
コード例 #10
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new MernisServiceAdapter());
            Gamer        gamer        = new Gamer()
            {
                FirstName     = "Davut",
                NationalityId = "86454653",
                DateOfBirth   = new DateTime(1961, 07, 26),
                LastName      = "istanbul",
                Id            = 1
            };
            Gamer gamer2 = new Gamer()
            {
                FirstName     = "gül",
                NationalityId = "346464678",
                DateOfBirth   = new DateTime(1978, 07, 26),
                LastName      = "İstanbul",
                Id            = 2
            };

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

            Game game = new Game()
            {
                Id          = 1,
                Name        = "GTA 6",
                Description = "Guzel oyun" +
                              "Helikopter gorevi var.",
                Price = 200
            };
            Game game2 = new Game()
            {
                Id          = 2,
                Name        = "PES",
                Description = "Futbol oyunu" +
                              "Kariyer modu geldi.",
                Price = 300
            };
            GameManager gameManager = new GameManager();

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

            Campaign campaign = new Campaign()
            {
                Id              = 1,
                Discount        = 80,
                Name            = "Summer Discount",
                CampaignEndTime = new DateTime(2021, 09, 26)
            };
            Campaign campaign2 = new Campaign()
            {
                Id              = 1,
                Discount        = 80,
                Name            = "Winter Discount",
                CampaignEndTime = new DateTime(2021, 03, 26)
            };
            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager salesManager = new SaleManager();

            salesManager.Sale(gamer, game);
            salesManager.CampaignSale(gamer, game, campaign);
            salesManager.Sale(gamer2, game2);
            salesManager.CampaignSale(gamer2, game2, campaign2);
        }
コード例 #11
0
        static void Main(string[] args)
        {
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            Gamer gamer1 = new Gamer()
            {
                FirstName     = "Ufuk",
                LastName      = "ALTAY",
                DateOfBirth   = 1985,
                NationalityId = 54331490504,
                Id            = 1
            };

            gamerManager.Add(gamer1);

            //OyuncuEkle(gamerManager);

            //Console.WriteLine("**************************************");
            //Console.WriteLine("Nasıl devam etmek istersiniz ?");
            //Console.WriteLine("Oyuncu eklemek için (1)");
            //Console.WriteLine("Oyuncu güncelleme için (2)");
            //Console.WriteLine("Oyuncu silme için (3)");

            //int tercih = Convert.ToInt32(Console.ReadLine());

            //switch (tercih)
            //{
            //    case 1:
            //        Console.WriteLine("Oyuncu Ekleme seçildi");
            //        break;
            //    case 2:
            //        Console.WriteLine("Oyuncu Güncelleme seçildi");
            //        break;
            //    case 3:
            //        Console.WriteLine("Oyuncu Silme seçildi");
            //        break;
            //    default:
            //        Console.WriteLine("Yanlış seçim yaptınız");
            //        break;
            //}

            gamerManager.Update(gamer1);
            gamerManager.Delete(gamer1);
            Console.WriteLine("**************************************");


            GameManager gameManager = new GameManager();
            Game        game1       = new Game()
            {
                GameId = 1, GameName = "Mario", GamePrice = 100
            };
            Game game2 = new Game()
            {
                GameId = 2, GameName = "Snake", GamePrice = 50
            };
            Game game3 = new Game()
            {
                GameId = 3, GameName = "Space Impact", GamePrice = 30
            };

            gameManager.Add(game1);
            gameManager.Add(game2);
            gameManager.Add(game3);
            gameManager.Delete(game2);
            gameManager.Update(game3);


            CampaignManager campaignManager = new CampaignManager();
            Campaign        campaign1       = new Campaign()
            {
                CampaignId = 1, CampaignName = "Efsane Cuma", CampaignDiscount = 15
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Şahane Kasım", CampaignDiscount = 20
            };

            campaignManager.Add(campaign1);
            campaignManager.Add(campaign2);
            campaignManager.Delete(campaign2);
            campaignManager.Update(campaign1);


            Console.ReadLine();
        }
コード例 #12
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                FirstName      = "Necdet",
                LastName       = "Aygün",
                BirthYear      = 1930,
                IdentityNumber = "12345678910"
            };

            Gamer gamer2 = new Gamer()
            {
                FirstName      = "Yasemin",
                LastName       = "Ünsal",
                BirthYear      = 1932,
                IdentityNumber = "10987654321"
            };

            Campaign campaign = new Campaign()
            {
                Id       = 1,
                Name     = "BigGame",
                Discount = 40
            };

            Game game = new Game()
            {
                Id        = 1,
                Name      = "Sims",
                Price     = 139,
                UnitStock = 12
            };


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

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

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

            GameManager gameManager = new GameManager();

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

            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer1, campaign, game);
            saleManager.Sale(gamer2, campaign, game);

            Console.Read();
        }
コード例 #13
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                FirstName     = "Mehmet Taha",
                LastName      = "Kocal",
                DateOfBirth   = new DateTime(2002, 03, 06),
                NationalityId = "13141256235"
            };

            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                FirstName     = "Kemal",
                LastName      = "Guler",
                DateOfBirth   = new DateTime(2002, 06, 12),
                NationalityId = "1241256235"
            };

            Gamer gamer3 = new Gamer()
            {
                Id            = 3,
                FirstName     = "Kerim Samet",
                LastName      = "Ayas",
                DateOfBirth   = new DateTime(2002, 06, 17),
                NationalityId = "12341256235"
            };

            Gamer gamer4 = new Gamer()
            {
                Id            = 4,
                FirstName     = "Sinan",
                LastName      = "Oztek",
                DateOfBirth   = new DateTime(2002, 01, 12),
                NationalityId = "12341256235"
            };

            GamerManager gamerManager = new GamerManager(new VerificationManager());

            gamerManager.SignUp(gamer1);
            gamerManager.SignUp(gamer2);
            gamerManager.Update(gamer3);
            gamerManager.Delete(gamer4);

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

            Game game1 = new Game()
            {
                Id        = 1,
                GameName  = "GTA V",
                GamePrice = 180
            };


            Game game2 = new Game()
            {
                Id        = 2,
                GameName  = "Rocket League",
                GamePrice = 32
            };

            Game game3 = new Game()
            {
                Id        = 3,
                GameName  = "Prepar 3D V5",
                GamePrice = 1600
            };


            GameManager gameManager = new GameManager();

            gameManager.Add(game1);
            gameManager.Delete(game2);
            gameManager.Update(game3);

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

            Campaign campaign1 = new Campaign()
            {
                Id           = 1,
                CampaignName = "KIS INDIRIMI !!!!",
                Discount     = 50
            };

            Campaign campaign2 = new Campaign()
            {
                Id           = 2,
                CampaignName = "YAZ INDIRIMI !!!!",
                Discount     = 35
            };

            Campaign campaign3 = new Campaign()
            {
                Id           = 3,
                CampaignName = "SONBAHAR INDIRIMI !!!!",
                Discount     = 70
            };

            SellManager sellManager = new SellManager();

            sellManager.Sell(game1, gamer1, campaign1);
            sellManager.Sell(game2, gamer2, campaign2);
            sellManager.Sell(game3, gamer3, campaign3);



            Console.ReadLine();
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: rmkarademir/KampIntro
        static void Main(string[] args)
        {
            List <Gamer>    gamers              = new List <Gamer>();
            IManagerService managerServiceGame  = new GameManager();
            IManagerService managerServiceGamer = new GamerManager();
            ISaleService    newyearsale         = new NewYearSaleManager();
            ISaleService    blackfridaysale     = new BlackFridaySaleManager();
            IEntity         gamer1              = new Gamer()
            {
                Name           = "Rüstem",
                Surname        = "Karademir",
                BirthYear      = 1991,
                SecurityNumber = "12346567890"
            };
            IEntity gamer2 = new Gamer()
            {
                Name           = "Muhammed",
                Surname        = "Karademir",
                BirthYear      = 1991,
                SecurityNumber = "12346567890"
            };
            IEntity game1 = new Game()
            {
                Name        = "Witcher 3",
                Catagory    = "Aksiyon",
                CompanyName = "Red Project",
                Price       = 50
            };
            IEntity game2 = new Game()
            {
                Name        = "Crysis",
                Catagory    = "Aksiyon",
                CompanyName = "Crytek",
                Price       = 30
            };

            managerServiceGamer.Add(gamer1);
            managerServiceGamer.Add(gamer2);
            managerServiceGame.Add(game1);
            managerServiceGame.Add(game2);
            Console.Clear();
            int xwhile = 1;

            while (xwhile == 1)
            {
                Console.WriteLine("**********MENU**********");
                Console.WriteLine("1) Oyuncu Ekle\n2) Oyuncu Sil\n3) Oyuncu Güncelle\n4) Oyuncuları Listele\n5) Oyun Ekle\n6) Oyun Sil\n7) Oyun Güncelle\n8) Oyunları Listele\n9) Kampanya Seçimi\n0) Çıkış");
                Console.WriteLine("************************");
                int secim = Convert.ToInt32(Console.ReadLine());
                Console.Clear();
                if (secim <= 9 && secim >= 0)
                {
                    switch (secim)
                    {
                    case 1:
                        Console.WriteLine("Oyuncu Adı: ");
                        string Name = Console.ReadLine();
                        Console.WriteLine("Oyuncu Soyadı: ");
                        string SurName = Console.ReadLine();
                        Console.WriteLine("Oyuncu Doğum Yılı: ");
                        int BirthYear = Convert.ToInt32(Console.ReadLine());
                        Console.WriteLine("Oyuncu TcNo: ");
                        string  SecurityNumber = Console.ReadLine();
                        IEntity gamer3         = new Gamer()
                        {
                            Name           = Name,
                            Surname        = SurName,
                            BirthYear      = BirthYear,
                            SecurityNumber = SecurityNumber
                        };
                        managerServiceGamer.Add(gamer3);
                        break;

                    case 2:
                        Console.WriteLine("Silmek istediğiniz oyuncunun Adını giriniz:");
                        managerServiceGamer.Delete(Console.ReadLine());
                        break;

                    case 3:
                        Console.WriteLine("Güncellemek istediğiniz oyuncunun Adını giriniz:");
                        string name = Console.ReadLine();
                        managerServiceGamer.Update(name);
                        break;

                    case 4:
                        managerServiceGamer.List();
                        break;

                    case 5:
                        Console.WriteLine("Oyun Adı: ");
                        string GameName = Console.ReadLine();
                        Console.WriteLine("Oyun Türü: ");
                        string Catagory = Console.ReadLine();
                        Console.WriteLine("Yapım Şirketi: ");
                        string CompanyName = Console.ReadLine();
                        Console.WriteLine("Oyun Fiyatı: ");
                        int     Price = Convert.ToInt32(Console.ReadLine());
                        IEntity game3 = new Game()
                        {
                            Name        = GameName,
                            Catagory    = Catagory,
                            CompanyName = CompanyName,
                            Price       = Price
                        };
                        managerServiceGame.Add(game3);
                        break;

                    case 6:
                        Console.WriteLine("Silmek istediğiniz oyunun Adını giriniz:");
                        managerServiceGame.Delete(Console.ReadLine());
                        break;

                    case 7:
                        Console.WriteLine("Güncellemek istediğiniz oyunun Adını giriniz:");
                        string Gamename = Console.ReadLine();
                        managerServiceGame.Update(Gamename);
                        break;

                    case 8:
                        managerServiceGame.List();
                        break;

                    case 9:
                        Console.WriteLine("Kampanya Menüsü");
                        Console.WriteLine("1) Yeni Yıl Kampanyası\n2) Efsane Cuma Kampanyası");
                        Console.WriteLine("---------------");
                        int secim2 = Convert.ToInt32(Console.ReadLine());
                        Console.Clear();

                        if (secim2 <= 2 && secim2 >= 1)
                        {
                            switch (secim2)
                            {
                            case 1:
                                managerServiceGame.List();
                                Console.WriteLine("Yeni Yıl kampanyası uygulamak istediğiniz oyunun adını yazınız: ");
                                string newyearsalegame = Console.ReadLine();
                                Console.Clear();
                                newyearsale.Sale(newyearsalegame);
                                break;

                            case 2:
                                managerServiceGame.List();
                                Console.WriteLine("Efsane Cuma kampanyası uygulamak istediğiniz oyunun adını yazınız: ");
                                string blackfridaysalegame = Console.ReadLine();
                                Console.Clear();
                                newyearsale.Sale(blackfridaysalegame);
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            Console.WriteLine("Hatalı giriş yaptınız.");
                        }
                        break;

                    case 0:
                        Console.WriteLine("Çıkış yapılıyor.");
                        xwhile = 0;
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Hatalı giriş yaptınız.");
                }
            }
        }