Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer();

            Console.Write("Adı:");
            gamer.FirstName = Console.ReadLine();
            Console.Write("Soyadı:");
            gamer.LastName = Console.ReadLine();
            Console.Write("T.c No:");
            gamer.IdentityNumber = long.Parse(Console.ReadLine());
            Console.Write("Doğum Yılı:");
            gamer.BirthYear = int.Parse(Console.ReadLine());

            UserValidationManager check = new UserValidationManager();


            if (check.Validate(gamer))
            {
                Console.WriteLine("Kayıt Bulundu");
            }
            else
            {
                Console.WriteLine("Böyle Bir Kayıt Bulunamadı");
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Gamer gamer1 = new Gamer();

            gamer1.Id            = 1;
            gamer1.FirstName     = "öznur";
            gamer1.LastName      = "krsy";
            gamer1.NationalityId = "12345";
            gamer1.DateOfBirth   = 1998;

            Game game1 = new Game();

            game1.Id    = 1;
            game1.Name  = "GTA";
            game1.Price = 50;

            Game game2 = new Game {
                Id = 2, Name = "Outlast", Price = 100
            };

            Campaign campaign1 = new Campaign();

            campaign1.Id           = 10;
            campaign1.CampaignName = "Şubat Kampanyası";
            campaign1.CampaignRate = 30;

            Campaign campaign2 = new Campaign {
                Id = 11, CampaignName = "Yeni yıl kampanyası", CampaignRate = 50
            };


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

            gamerManager.Add(gamer1);


            GameManager gameManager = new GameManager();

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

            CampaignManager campaignManager = new CampaignManager();

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

            SalesManager salesManager = new SalesManager();

            salesManager.Sales(game2, gamer1);
            salesManager.CampaignSales(gamer1, game1, campaign2);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            IPersonDol playerManager = new PlayerManager();
            Player     player        = new Player()
            {
                Id = 1, BirthYear = 2001, FirstName = "Fatih", LastName = "Çayır", TC = 1235
            };
            Game game = new Game()
            {
                Id = 1, Name = "CS:GO", UnitPrice = 10
            };
            UserValidationManager userValidation = new UserValidationManager();

            if (userValidation.Validate(player) == true)
            {
                playerManager.Add(player);
            }
            else
            {
                Console.WriteLine("Doğrulama başarısız");
            }


            SellingManager selling = new SellingManager();

            selling.Sell();
            CampaignManager campaign = new CampaignManager();

            campaign.EndOfYearCampaign(player, game);
            campaign.Delete();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            UserValidationManager userValidationManager = new UserValidationManager();
            GamerManager          gamerManager          = new GamerManager(userValidationManager);

            Gamer gamer = new Gamer
            {
                Id             = 1,
                FirstName      = "Oğzuhan",
                LastName       = "Molla",
                BirthYear      = 2006,
                IdentityNumber = 2146832092
            };

            gamerManager.Add(gamer);

            //Console.WriteLine("Hello World!");
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            //Oyuncu eklendi.
            Gamer gamer1 = new Gamer()
            {
                Id          = 123,
                FirstName   = "Cengizhan",
                LastName    = "Anar",
                DateOfBirth = 1990,
                TcNo        = 1234,
            };
            //Oyun eklendi.
            Game game1 = new Game();

            game1.GameId    = 123;
            game1.GameName  = "Atmaca";
            game1.GamePrice = 10;
            //Kampanya eklendi.
            Campaign campaign = new Campaign();

            campaign.CampaignId   = 123;
            campaign.CampaignName = "Campaign Of Summer";
            campaign.CampaignRate = 20;

            UserValidationManager userValidationManager = new UserValidationManager();

            GamerManager gamerManager = new GamerManager(userValidationManager);

            gamerManager.Add(gamer1);

            GameManager gameManager = new GameManager();

            gameManager.Add(game1);

            SalesManager salesManager = new SalesManager();

            salesManager.Buy(gamer1, game1);
            salesManager.BuyCampaing(gamer1, game1, campaign);
        }
Exemplo n.º 6
0
        //6.gun
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer()
            {
                GamerId        = 1,
                FirstName      = "ENGIN",
                LastName       = "DEMIROG",
                YearOfBirth    = 1985,
                IdentityNumber = 12345
            };

            Gamer gamer2 = new Gamer()
            {
                GamerId        = 1,
                FirstName      = "ENGIN",
                LastName       = "DEMIROG",
                YearOfBirth    = 1986,
                IdentityNumber = 12345
            };

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

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

            Console.WriteLine("-----------------------");
            EStateUserValidationManager eStateUserValidationManager = new EStateUserValidationManager();
            GamerManager gamerManager1 = new GamerManager(eStateUserValidationManager);

            gamerManager1.Add(gamer);



            Console.ReadLine();
        }
Exemplo n.º 7
0
 public GamerManager(UserValidationManager userValidationManager)
 {
     this.userValidationManager = userValidationManager;
 }
Exemplo n.º 8
0
 public GamerManager(UserValidationManager userValidationManager)
 {
     userValidationService = userValidationService; 
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            User user1 = new User()
            {
                UserId = 1, UserFirstName = "Olcay", UserLastName = "Güneş", UserBirthYear = 1992, UserTcNo = "1234567890"
            };
            User user2 = new User()
            {
                UserId = 2, UserFirstName = "Engin", UserLastName = "Demiroğ", UserBirthYear = 1988, UserTcNo = "9876543210"
            };
            User user3 = new User()
            {
                UserId = 3, UserFirstName = "Ali", UserLastName = "Yılmaz", UserBirthYear = 2000, UserTcNo = "6543219870"
            };

            Game game1 = new Game()
            {
                GameId = 1, GameName = "Football Manager 2021", GamePrice = 150
            };
            Game game2 = new Game()
            {
                GameId = 2, GameName = "PES 2021", GamePrice = 200
            };
            Game game3 = new Game()
            {
                GameId = 3, GameName = "FIFA 2021", GamePrice = 250
            };

            Campaign campaign1 = new Campaign()
            {
                CampaignId = 1, CampaignName = "Black Friday", CampaignDiscount = 50
            };
            Campaign campaign2 = new Campaign()
            {
                CampaignId = 2, CampaignName = "Yeni Yıl İndirimi", CampaignDiscount = 40
            };

            Sale sale1 = new Sale()
            {
                SaleId = 1, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "Football Manager 2021", CampaignName = "Black Friday", TotalPrice = (game1.GamePrice) * 0.5
            };
            Sale sale2 = new Sale()
            {
                SaleId = 2, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "PES 2021", CampaignName = "Yeni Yıl İndirimi", TotalPrice = (game2.GamePrice) * 0.6
            };
            Sale sale3 = new Sale()
            {
                SaleId = 3, UserFirstName = "Olcay", UserLastName = "Güneş", GameName = "FIFA 2021", CampaignName = "Black Friday", TotalPrice = (game1.GamePrice) * 0.5
            };

            UserValidationManager userValidationManager = new UserValidationManager();
            UserManager           userManager           = new UserManager(userValidationManager);
            GameManager           gameManager           = new GameManager();
            CampaignManager       campaignManager       = new CampaignManager();
            SaleManager           saleManager           = new SaleManager();

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

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

            userManager.Add(user1);
            userManager.Add(user2);
            userManager.Add(user3);

            saleManager.Sale(sale1);
            saleManager.Sale(sale2);
            saleManager.Sale(sale3);
        }
Exemplo n.º 10
0
 public GamerProject(UserValidationManager userValidationManager)
 {
     this.userValidationManager = userValidationManager;
 }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            Game game = new Game();

            game.GameName = "CsGo";
            game.Price    = 35;
            game.Id       = 123456789;

            Game game1 = new Game();

            game1.GameName = "Pubg";
            game1.Id       = 987632100;
            game1.Price    = 43;


            Campaign campaign1 = new Campaign();

            campaign1.CampaignName = "Yılbaşı";
            campaign1.DiscountRate = 30;
            campaign1.CampaignId   = 1;

            Campaign campaign2 = new Campaign();

            campaign2.CampaignName = "11.11";
            campaign2.DiscountRate = 50;
            campaign2.CampaignId   = 2;

            Sales sales1 = new Sales();

            sales1.GamePrice = 30;

            Sales sales2 = new Sales();

            sales2.GamePrice = 45;


            Gamer gamer1 = new Gamer();

            gamer1.Id        = 3;
            gamer1.FirstName = "Alperen";
            gamer1.LastName  = "Büber";
            gamer1.TcNo      = "123456789";

            Gamer gamer2 = new Gamer();

            gamer2.Id        = 4;
            gamer2.FirstName = "Kerem";
            gamer2.LastName  = "Kerem";
            gamer2.TcNo      = "987654321";

            Gamer gamer3 = new Gamer();

            gamer3.BirthDay  = "1985";
            gamer3.FirstName = "Alperen";

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign2);


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

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


            GameManager gameManager = new GameManager();

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

            UserValidationManager userValidationManager = new UserValidationManager();

            userValidationManager.Validate(gamer1);
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer
            {
                TC        = "1234567890",
                FirstName = "BARIŞ",
                LastName  = "ASLAN",
                BirthYear = "2000"
            };

            Game game1 = new Game
            {
                GameName  = "Red Dead Redemption 2",
                GamePrice = 300
            };
            Game game2 = new Game
            {
                GameName  = "CyberPunk 2077",
                GamePrice = 200
            };
            Game game3 = new Game
            {
                GameName  = "The Last Of Us Part2",
                GamePrice = 150
            };

            Campaign campaign70 = new Campaign
            {
                CampaignId      = 1,
                CampaignName    = "200TL Üzeri 70TL Kupon",
                CampaignEndDate = "02.03.2021"
            };

            Sale sale = new Sale
            {
                Gamer     = gamer.FirstName + gamer.LastName,
                GameName  = game3.GameName,
                GamePrice = game3.GamePrice
            };



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

            gamerManager.Add(gamer);
            if (userValidationManager.Validate(gamer) == true)
            {
                Console.WriteLine("");

                Console.WriteLine("OYUNLAR");
                GameManager gameManager = new GameManager();
                gameManager.Add(game1);
                gameManager.Add(game2);
                gameManager.Add(game3);

                Console.WriteLine("");

                Console.WriteLine("KAMPANYALAR");
                CampaignManager campaignManager = new CampaignManager();
                campaignManager.Add(campaign70);

                Console.WriteLine("");

                Console.WriteLine("SON İŞLEMLER");
                SaleManager saleManager = new SaleManager();
                if (sale.GamePrice >= 200)
                {
                    saleManager.CampaignSale(gamer, sale, campaign70);
                }
                else
                {
                    saleManager.Sale(gamer, sale);
                }
            }
        }