Exemple #1
0
        public static void Main(string[] args)
        {
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            Gamer gamer = new Gamer()
            {
                GamerId       = 1,
                NationalityId = "52753464950",
                FirstName     = "Merve",
                LastName      = "ALKAN",
                DateOfBirth   = new System.DateTime(1998, 6, 7)
            };

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

            Game game = new Game()
            {
                GameId          = 2,
                GameName        = "Dota 2",
                GameDescription = "A Modern Multiplayer Masterwork",
                GamePrice       = 150
            };

            GameManager gameManager = new GameManager();

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

            Campaign campaign = new Campaign()
            {
                CampaignId       = 3,
                CampaignDiscount = 20,
                CampaignName     = "Dota 2 Discount"
            };
            CampaignManager campaignManager = new CampaignManager();

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

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(gamer, game);
            salesManager.CampaignSale(gamer, game, campaign);

            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("GameProjectDemo V1 created by Eda Arabacı");
            //added GAMER
            Gamer gamer1 = new Gamer {
                Id = 1, FirstName = "Eda", LastName = "Arabacı", DayOfBirth = new DateTime(1000, 1, 2), NationalId = "12345678901"
            };

            GamerManager gamerManager = new GamerManager(new GamerCheckManager());

            gamerManager.Add(gamer1);


            //Added GAMES
            Game game1 = new Game {
                Id = 1, GameId = 1010, GameName = "WeakCircle", GamePrice = 85.50, GameType = "Strategy Game", UnitStock = 10
            };
            Game game2 = new Game {
                Id = 2, GameId = 1011, GameName = "Vengeance II", GamePrice = 150, GameType = "War Game", UnitStock = 0
            };

            GameManager gameManager = new GameManager();

            gameManager.AddGame(game1);
            gameManager.UpdateGame(game2);

            //Added OFFERS
            SpecialOffer specialOffer1 = new SpecialOffer {
                Id = 1, OfferId = 101, OfferName = "Winter is comming", DiscountRate = 10
            };
            SpecialOffer specialOffer2 = new SpecialOffer {
                Id = 2, OfferId = 102, OfferName = "Happy Mondays", DiscountRate = 50
            };

            SpecialOfferManager specialOfferManager = new SpecialOfferManager();

            specialOfferManager.OfferAdd(specialOffer1);
            specialOfferManager.OfferUpdate(specialOffer2);


            //BASKET OPERATIONS
            SaleManager saleManager = new SaleManager(new CalculateDiscountManager(), new OfferStockCheckService());

            saleManager.AddBasket(game1, gamer1, specialOffer2);
            saleManager.AddBasket(game2, gamer1, specialOffer1);
            saleManager.DeleteBasket(game1, gamer1);
            saleManager.Buy(game2, gamer1);
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            //Doğru bilgiler girilmeden hata verir
            BaseGamerManager gamerManager = new GamerManager(new MernisServiceAdapter());

            gamerManager.Add(new Gamer
            {
                DateOfBirth   = new DateTime(1995, 5, 11),
                FirstName     = "Cevat",
                LastName      = "Sarıkaya",
                NationalityId = "12536"
            });

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(new Campaign
            {
                Id       = 2,
                Name     = "1 al 2 öde",
                Discount = 10
            });

            ProductManager productManager = new ProductManager();

            productManager.Add(new Product
            {
                Id    = 3,
                Name  = "Mario",
                Price = 15
            });

            SalesManager salesManager = new SalesManager();

            salesManager.Add(new Gamer {
                FirstName = "Cevat"
            }, new Product {
                Name = "Mario"
            }, new Campaign {
                Name = "1 al 2 öde"
            });
        }
Exemple #4
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer {
                Id = 1, FirstName = "ENGİN", LastName = "DEMİROĞ", BirthYear = 1985, IdentityNumber = 12345
            });
            Console.WriteLine("Hello World!");

            Game game1 = new Game();

            game1.Id       = 1;
            game1.GameName = "Basketball";
            game1.Price    = 25;

            Game game2 = new Game();

            game2.Id       = 2;
            game2.GameName = "Futball";
            game2.Price    = 13;

            Campaign campaign1 = new Campaign();

            campaign1.CampaignId   = 5;
            campaign1.CampaignName = "Fırsat";
            campaign1.DiscountRate = 15;


            CampaignManager campaignManager1 = new CampaignManager();

            campaignManager1.Add(game2);
            campaignManager1.Delete(game1);

            SalesManager salesManager = new SalesManager();

            salesManager.Sell(game1, campaignManager1, campaign1);
        }
Exemple #5
0
        static void Main(string[] args)
        {
            GameManager  gameManager  = new GameManager();
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer
            {
                Id            = 1,
                FirstName     = "Enes",
                LastName      = "ÖZTEPE",
                DateOfBirth   = new DateTime(2000, 1, 1),
                NationalityId = "12345678910"
            }
                             );
            gamerManager.Add(new Gamer
            {
                Id            = 2,
                FirstName     = "Ali",
                LastName      = "VELİ",
                DateOfBirth   = new DateTime(1995, 5, 5),
                NationalityId = "11111111111"
            }
                             );
            gamerManager.Update(new Gamer
            {
                Id            = 2,
                FirstName     = "ENGİN",
                LastName      = "DEMİROĞ",
                DateOfBirth   = new DateTime(1995, 5, 5),
                NationalityId = "11111111111"
            });
            gamerManager.Delete(new Gamer
            {
                Id            = 2,
                FirstName     = "ENGİN",
                LastName      = "DEMİROĞ",
                DateOfBirth   = new DateTime(1995, 5, 5),
                NationalityId = "11111111111"
            });


            gameManager.GameBuying(new Gamer
            {
                Id            = 1,
                FirstName     = "ENGİN",
                LastName      = "DEMİROĞ",
                DateOfBirth   = new DateTime(1995, 5, 5),
                NationalityId = "11111111111"
            }, new Game
            {
                Id    = 1,
                Name  = "Resident evil",
                Price = 100
            },
                                   new Campaign
            {
                Id             = 1,
                Name           = "Cadılar Bayramı",
                Description    = "Korku oyunları indirimi %50",
                RateOfDiscount = 0.5
            });

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //Game'lerin oluşturuldu kısım
            Game game1 = new Game
            {
                GameName     = "Last Of Us 2",
                GameCategory = "Hayatta Kalma",
                GamePrice    = 250
            };
            Game game2 = new Game
            {
                GameName     = "Uncharted 4",
                GameCategory = "Macera",
                GamePrice    = 350
            };
            Game game3 = new Game
            {
                GameName     = "God Of War",
                GameCategory = "Aksiyon, Dövüş",
                GamePrice    = 450
            };

            //Kampanyaların Oluşturulduğ Kısım
            Campaigns campaign1 = new Campaigns();

            campaign1.CampaignName     = "Yaz İndirimi";
            campaign1.CampaignDiscount = 50;

            Campaigns campaign2 = new Campaigns();

            campaign2.CampaignName     = "Haftasonu İndirimi";
            campaign2.CampaignDiscount = 25;


            //Gamer'ların oluşturuluğu kısım
            Gamer gamer1 = new Gamer
            {
                FirstName     = "Engin ",
                LastName      = "Demiroğ",
                NationalityId = "12345678910",
                DateOfBirth   = new DateTime(1985, 1, 6)
            };
            Gamer gamer2 = new Gamer
            {
                FirstName     = "Zeynel ",
                LastName      = "Toplar",
                NationalityId = "10987654321",
                DateOfBirth   = new DateTime(1998, 10, 20)
            };

            //Gamer'ların yönetildiği kısım (Add, Update, Delete)
            GamerManager gamerManager = new GamerManager(new VerificationManager());

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

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

            //Game'lerin yönetildiği kısım
            GameManager gameManager = new GameManager();

            gameManager.Add(game1);

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


            gameManager.Add(game2);

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

            //Kampanyaların yönetildiği kısım
            CampaignManager campaignManager = new CampaignManager();

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

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

            //Oyun satışlarının yönetildiği kısım.
            GameSaleManager gameSaleManager = new GameSaleManager();

            gameSaleManager.Sale(gamer1, game1, campaign1);

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

            gameSaleManager.Sale(gamer2, game3, campaign2);



            Console.ReadLine();
        }
Exemple #7
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                NationalityId = "12345678910",
                FirstName     = "Kadir Uğur",
                LastName      = "Mert",
                DateOfBirth   = new DateTime(1990, 10, 07)
            };

            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                NationalityId = "12345678910",
                FirstName     = "Uğur",
                LastName      = "Mert",
                DateOfBirth   = new DateTime(1990, 10, 07)
            };

            GamerManager gamerManager = new GamerManager(new GamerCheckManager());

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

            Game game1 = new Game()
            {
                Id        = 1,
                GameName  = "Cyberpunk 2077",
                GamePrice = 249
            };

            Game game2 = new Game()
            {
                Id        = 2,
                GameName  = "Microsoft Flight Simulator",
                GamePrice = 349
            };

            GameManager gameManager = new GameManager();

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

            Campaign campaign = new Campaign
            {
                Id                = 1,
                CampaignName      = "New Year",
                CampaignStartDate = new DateTime(2021, 01, 01),
                CampaignDuration  = 30,
                Discount          = 21,
            };

            CampaignManager campaignManager = new CampaignManager();

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

            SaleManager saleManager = new SaleManager();

            saleManager.Sale(gamer1, game1);
            saleManager.Sale(gamer1, game2, campaign);
        }
Exemple #8
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new NewUserValidation());

            gamerManager.Add(new Gamer
            {
                Id        = 1,
                NickName  = "xyzw",
                FirstName = "qwerty",
                LastName  = "asdfg",
                Mail      = "*****@*****.**",
                TcNum     = 123456789,
                BirthYear = 19
            });

            OrderManager    orderManager    = new OrderManager();
            GamerManager    gameManager     = new GameManager();
            CampaingManager kampanyaManager = new CampaingManager();

            Games game1 = new Games();

            game1.GameId    = 1;
            game1.GameName  = "Satranç";
            game1.GamePrice = 150;
            gameManager.Ekle(game1);
            Console.WriteLine("---------------------------");
            Console.WriteLine("");


            Games game2 = new Games();

            game2.GameId    = 2;
            game2.GameName  = "Mangala";
            game2.GamePrice = 200;
            gameManager.Ekle(game2);
            Console.WriteLine("---------------------------");
            Console.WriteLine("");

            Games game3 = new Games();

            game3.GameId    = 3;
            game3.GameName  = "Go";
            game3.GamePrice = 100;
            gameManager.Ekle(game3);
            Console.WriteLine("---------------------------");
            Console.WriteLine("");

            Gamer gamer1 = new Gamer();

            gamer1.Id        = 1;
            gamer1.NickName  = "Muhibbi";
            gamer1.FirstName = "Kanuni Sultan Süleyman";
            gamer1.LastName  = "Kanuni";
            gamer1.Mail      = "muhteş[email protected]";
            gamer1.TcNum     = 149400046;
            gamer1.BirthYear = 1494;
            gamerManager.Add(gamer1);

            Console.WriteLine("Oyuncu " + gamer1.NickName + " kaydedildi ! ");
            Console.WriteLine("");
            Console.WriteLine("---------------------------");

            Gamer gamer2 = new Gamer();

            gamer2.Id        = 2;
            gamer2.NickName  = "Avni";
            gamer2.FirstName = "Fatih Sultan Mehmet";
            gamer2.LastName  = "Fatih";
            gamer2.Mail      = "*****@*****.**";
            gamer2.TcNum     = 143200030;
            gamer2.BirthYear = 1432;
            gamerManager.Add(gamer2);
            Console.WriteLine("Oyuncu " + gamer2.NickName + " kaydedildi ! ");
            Console.WriteLine("");
            Console.WriteLine("---------------------------");

            Gamer gamer3 = new Gamer();

            gamer3.Id        = 3;
            gamer3.NickName  = "Selimi";
            gamer3.FirstName = "Yavuz Sultan Selim";
            gamer3.LastName  = "Yavuz";
            gamer3.Mail      = "*****@*****.**";
            gamer3.TcNum     = 147000008;
            gamer3.BirthYear = 1470;
            gamerManager.Add(gamer3);
            Console.WriteLine("Oyuncu " + gamer3.NickName + " kaydedildi ! ");
            Console.WriteLine("");
            Console.WriteLine("---------------------------");



            Campaing kampanya1 = new Campaing();

            CampaingManager.KampOner(kampanya1);
            Console.WriteLine(kampanya1.KampanyaName);
            kampanya1.KampanyaId   = 01;
            kampanya1.KampanyaKodu = 101;
            kampanya1.KampanyaName = "İlk Kayıtta % 10 İndirim !";
            Console.WriteLine(" Tebrikler %10 indiriim kazandınız ! ");
            Console.WriteLine("*****************************");

            Campaing kampanya2 = new Campaing();

            kampanyaManager.KampOner(kampanya2);
            Console.WriteLine(kampanya2.KampanyaName);
            kampanya2.KampanyaId   = 02;
            kampanya2.KampanyaKodu = 102;
            kampanya2.KampanyaName = "Bir Oyun Alana 2. Oyun %35 İndirimli !";
            Console.WriteLine(" Sana özel öneri: 2. oyun %35 indirimli ! ");
            Console.WriteLine("*****************************");

            Orders order1 = new Orders();

            order1.OrderId   = 001;
            order1.GameId    = 1;
            order1.GameName  = "Satranç";
            order1.GamePrice = 150;
            order1.Id        = 1;
            order1.NickName  = "Muhibbi";
            orderManager.OrderEkle(order1, gamer1);
            Console.WriteLine("");

            Orders order2 = new Orders();

            order2.OrderId   = 002;
            order2.GameId    = 2;
            order2.GameName  = "Mangala";
            order2.GamePrice = 200;
            order2.Id        = 2;
            order2.NickName  = "Avni";
            orderManager.OrderEkle(order2, gamer2);
            Console.WriteLine("");

            Orders order3 = new Orders();

            order3.OrderId   = 003;
            order3.GameId    = 3;
            order3.GameName  = "Go";
            order3.GamePrice = 100;
            order3.Id        = 3;
            order3.NickName  = "Selimi";
            orderManager.OrderEkle(order3, gamer3);
            Console.ReadLine();
        }