Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            PlayerManager playerManager = new PlayerManager(new PersonCheckManager());

            //Person
            playerManager.Add(new Person {
                Id      = 1, NationalityId = "12345678", Name = "Game",
                Surname = "Player", DateOfBirth = new DateTime(1989, 01, 01)
            });
            //Game
            Game game1 = new Game {
                GameId = 2, GameName = "Age of Empires", Price = 100
            };
            Game game2 = new Game {
                GameId = 3, GameName = "Counter-Strike", Price = 75
            };
            //Player
            Player player1 = new Player {
                UserName = "******", Password = "******", Email = "*****@*****.**", Balance = 500
            };
            //campain
            Campaing campaing1 = new Campaing {
                CampaingId = 1, CampaingName = "Discount campaign", DiscountRate = 10
            };

            SalesManager salesManager = new SalesManager();

            salesManager.Buy(player1, game1);
            salesManager.Discount(campaing1, game1);
            salesManager.ReturnBackGame(game1);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ICustomerService customerService = new CustomerManager(new MernisServiceAdapter());

            customerService.Save(new Customer()
            {
                FirstName   = "Zeynep Miray", LastName = "Ertunç",
                DateofBirth = new DateTime(1998, 1, 12), NationalityId = "2222222222"
            });

            ISellService sellService = new SalesManager();
            Product      product1    = new Product()
            {
                GameName = "LOL", GamePrice = 100
            };

            sellService.SellCampaign(new Customer()
            {
                FirstName = "Zeynep Miray"
            }, new Campain()
            {
                CampaignName = "BlackFriday", CampaignPrice = product1.GamePrice / 2
            }, new Product()
            {
                GameName = product1.GameName
            });
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Game game1 = new Game()
            {
                Id = 1, Name = "Pubg", Price = 500
            };
            Game game2 = new Game()
            {
                Id = 2, Name = "Call of Duty", Price = 750
            };
            Gamer gamer1 = new Gamer()
            {
                Id = 1, FirstName = "TUFAN", LastName = "ÇEVİK", BirthYear = new DateTime(1993, 04, 18), NationalityId = "54493378456",
                CreditCardNumber = 132465798, UserName = "******"
            };
            Gamer gamer2 = new Gamer()
            {
                Id               = 1,
                FirstName        = "Emin",
                LastName         = "Çölaşan",
                BirthYear        = new DateTime(1991, 11, 05),
                NationalityId    = "54493378456",
                CreditCardNumber = 132465798,
                UserName         = "******"
            };


            Campaign campaign = new Campaign()
            {
                GameId = 3, CampaignName = "Back to Sunny", RateOfDiscount = 15
            };
            CampanyManager campanyManager = new CampanyManager();

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


            CustomerManger customerManger = new GamerManager(new MernisServiceAdapter());

            customerManger.Save(gamer1);
            customerManger.Save(gamer2);
            //customerManger.Delete(gamer1);

            Sales sales1 = new Sales()
            {
                Game = game1.Name, Gamer = gamer1.FirstName
            };
            Sales sales2 = new Sales()
            {
                Game = game2.Name, Gamer = gamer2.FirstName
            };
            SalesManager salesManager = new SalesManager();

            salesManager.Buy(game1, gamer1);
            salesManager.Buy(game2, gamer2);

            Console.ReadLine();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            //kimlik doğrulama

            Player player = new Player
            {
                DateOfBirth   = new DateTime(1994, 11, 23),
                FirstName     = "Şeyma",
                LastName      = "Demir",
                NationalityId = 123456789
            };
            BasePlayerManager playerManager = new PlayerManager(new MernisServiceAdapter());

            playerManager.Save((Player)player);


            //oyuncu silme-güncelleme
            BasePlayerManager playerManager1 = new PlayerManager();

            playerManager1.Delete((Player)player);
            playerManager1.Update((Player)player);


            //kampanya ekle-sil-güncelle
            Campaign campaign = new Campaign
            {
                CampaignId      = 1,
                CampaignName    = "Patron Çıldırdı",
                CampaignDetails = "2021 yılı sonuna kadar sürecek!"
            };

            Campaign campaign1 = new Campaign
            {
                CampaignId      = 2,
                CampaignName    = "Kapatıyoruz",
                CampaignDetails = "2021 Ocak'ta sona erdi..."
            };

            BaseCampaignManager campaignManager = new CampaignManager();

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


            //oyuncu ve satış

            IGameSalesService gameSales = new SalesManager();

            gameSales.Save((Player)player, (Campaign)campaign);
            gameSales.Update((Player)player, (Campaign)campaign);
            gameSales.Delete((Player)player, (Campaign)campaign1);
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            Console.WriteLine("**********Üye Kaydı*********");

            BaseGamerManager gamerManager = new BaseGamerManager(new MernisServiceAdapter());

            gamerManager.Add(new Entities.Gamer
            {
                DateOfBirth   = new DateTime(1983, 9, 23),
                FirstName     = "MURAT",
                LastName      = "FIRTINA",
                NationalityId = "44689425372"
            });
            Console.ReadLine();

            Product product1 = new Product {
                ProductId = 10, ProductName = "FIFA2021", ProductUnitPrice = 90
            };
            Product product2 = new Product {
                ProductId = 11, ProductName = "NFS7", ProductUnitPrice = 80
            };
            Product product3 = new Product {
                ProductId = 12, ProductName = "PES2021", ProductUnitPrice = 95
            };

            Campaign campaign1 = new Campaign {
                CampaignId = 20, CampaignName = "Yeni Yıl", DicountRate = 10
            };
            Campaign campaign2 = new Campaign {
                CampaignId = 21, CampaignName = "Hızlı ve Ucuz", DicountRate = 15
            };
            Campaign campaign3 = new Campaign {
                CampaignId = 22, CampaignName = "Futbol Haftası", DicountRate = 5
            };

            ProductManager  productManager  = new ProductManager();
            CampaignManager campaignManager = new CampaignManager();
            SalesManager    salesManager    = new SalesManager();

            Console.WriteLine("************Oyunlar************\n");
            List <Product> productsList = new List <Product> {
                product1, product2, product3
            };

            productManager.GetAll(productsList);

            Console.WriteLine("************Kampanyalar************\n");
            List <Campaign> campaignList = new List <Campaign> {
                campaign1, campaign2, campaign3
            };

            campaignManager.GetAll(campaignList);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            GameDb gameDb       = new GameDb();
            var    validation   = new UserValidationManager();
            var    gamerManager = new GamerManager(validation, gameDb);
            Gamer  gamer1       = new Gamer
            {
                Id         = 1,
                UserName   = "******",
                Email      = "salsağ@hotmail.com",
                FirstName  = "Salih",
                LastName   = "Sağsalim",
                IdentityNo = "11111111111",
                DOB        = new DateTime(01 / 01 / 199)
            };
            Gamer gamer2 = new Gamer
            {
                Id         = 1,
                UserName   = "******",
                Email      = "salsağ@hotmail.com",
                FirstName  = "Salih",
                LastName   = "Sağsalim",
                IdentityNo = "11111111111",
                DOB        = new DateTime(01 / 01 / 199)
            };

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

            var      salesManager    = new SalesManager(gameDb);
            var      campaignManager = new CampaignManager(gameDb);
            var      campaignList    = new List <Campaign>();
            Campaign campaign        = new Campaign
            {
                Id       = 1,
                Name     = "No Campaign",
                Discount = 0
            };

            campaignList.Add(campaign);

            Sale sale = new Sale
            {
                Id        = 1,
                GamerId   = 1,
                Gamer     = gamer1,
                SaleDate  = DateTime.Now,
                Campaigns = campaignList
            };

            salesManager.Add(sale);
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            IAccount kemal = new User {
                UserId = 320, Name = "Kemal", Surname = "Dayı", Id = 31, Mail = "*****@*****.**", TcNo = 1234
            };
            IAccount burak = new Admin {
                AdminId = 42, Name = "Burak", Surname = "Yıldız", Id = 12, Mail = "*****@*****.**"
            };
            Sales hall = new Sales {
                PackageName = "Token in the hall", Price = "21Tl", Tokens = 1000
            };
            Sales start = new Sales {
                PackageName = "Starter Pack", Price = "13Tl", Tokens = 750
            };



            AccountManager accountManager = new AccountManager();

            accountManager.Verify(kemal);
            accountManager.Delete(kemal);
            accountManager.Update(kemal);
            accountManager.Register(kemal);
            Console.WriteLine("##############################################################");

            accountManager.Verify(burak);
            accountManager.Delete(burak);
            accountManager.Update(burak);
            accountManager.Register(burak);
            Console.WriteLine("##############################################################");

            SalesManager salesManager = new SalesManager();

            salesManager.BoughtFor(hall, kemal);
            salesManager.defined(hall, kemal);
            salesManager.StudentDiscount(hall, kemal);
            salesManager.PackageUpdate(hall);
            salesManager.DeletePackage(hall);
            Console.WriteLine("##############################################################");

            salesManager.BoughtFor(start, burak);
            salesManager.defined(start, burak);
            salesManager.StudentDiscount(start, burak);
            salesManager.PackageUpdate(start);
            salesManager.DeletePackage(start);
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            //Bir oyun yazmak istiyorsunuz. Bu yazılım için backend kodlarını C# ile geliştirmeyi planlıyoruz. Yeni üye,
            //satış ve kampanya yönetimi yapılması isteniyor. Nesnelere ait özellikleri istediğiniz gibi verebilirsiniz.
            //Burada amaç yazdığınız kodun kalitesidir. Ödevde gereksinimleri tam anlamadığınız durum benim için önemli değil,
            //kendinize göre mantık geliştirebilirsiniz.



            //Gereksinimler

            //1.Oyuncuların sisteme kayıt olabileceği, bilgilerini güncelleyebileceği, kayıtlarını silebileceği
            //bir ortamı simule ediniz.Müşteri bilgilerinin doğruluğunu e-devlet sistemlerini kullanarak
            //doğrulama yapmak istiyoruz. (E - devlet sistemlerinde doğrulama TcNo, Ad, Soyad, DoğumYılı bilgileriyle yapılır.
            //Bunu yapacak servisi simule etmeniz yeterlidir.)

            //2.Oyun satışı yapılabilecek satış ortamını simule ediniz.(Yapılan satışlar oyuncu ile ilişkilendirilmelidir.
            //Oyuncunun parametre olarak metotta olmasını kastediyorum.)

            //3.Sisteme yeni kampanya girişi, kampanyanın silinmesi ve güncellenmesi imkanlarını simule ediniz.

            //4.Satışlarda kampanya entegrasyonunu simule ediniz.

            //************************ PROJECT SOURCE CODE *************************************************//


            //MÜŞTERİ OLUŞTURDUM VE DAHA SONRA MÜŞTERİLERİN KAYITLI OLUP OLMADIKLARINI KONTROL ETTİM//
            Customer customer1 = new Customer()
            {
                FirstName = "donald", LastName = "george", Password = "******", Birthdate = 1996, Id = 2
            };
            CustomerManager customerManager1 = new CustomerManager(new UserValidationManager());

            Customer customer2 = new Customer()
            {
                FirstName = "John", LastName = "Degree", Password = "******", Id = 1, Birthdate = 1999
            };
            CustomerManager customerManager2 = new CustomerManager(new UserValidationManager());
            //******************************************************************************************

            //OYUN OLUŞTURDUM VE OYUNLARDA EKLEME SİLME GÜNCELLEME İŞLEMLERİ YAPTIM:
            Game game1 = new Game()
            {
                GameID = 1, GameName = "among us", GamePrice = 12
            };

            Game game2 = new Game()
            {
                GameID = 2, GameName = "temple run", GamePrice = 10
            };


            GameManager gameManager = new GameManager();

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

            //**********************************************************************

            //İNDİRİMLERİ TANIMLADIM VE EKLEME SİLME GÜNCELLEME İŞLEMLERİNİ GERÇEKLEŞTİRDİM
            Campaign campaign1 = new Campaign()
            {
                CampaignName = "black friday indirimi", CampaignDiscountRate = 30, CampaignId = 7
            };

            Campaign campaign2 = new Campaign()
            {
                CampaignDiscountRate = 50, CampaignName = "Ramazan indirimi", CampaignId = 8
            };

            CampaignManager campaignManager = new CampaignManager();

            campaignManager.DeleteCampaign(campaign1);
            campaignManager.NewCampaing(campaign2);
            campaignManager.UpdateCampaign(campaign1);
            campaignManager.UpdateCampaign(campaign2);

            //********************************************************************

            //SATIŞLARI YAPILAN OYUNLARI VE ONU ALAN KİŞİYE DAİR BİLGİLERİ İNDİRİMLİ FİYATI TANIMLADIM.
            //DAHA SONRA SATIŞLARA DAİR BİLGİLERİ TANIMLADIM:
            Sale sales1 = new Sale()
            {
                Game            = game1,
                Customer        = customer1,
                DiscountedPrice = 8
            };

            Sale sales2 = new Sale()
            {
                Game            = game2,
                Customer        = customer2,
                DiscountedPrice = 6
            };

            SalesManager salesManager = new SalesManager();

            salesManager.Sales(sales1);
            salesManager.Sales(sales2);
            salesManager.CampaignSales(sales1);
            salesManager.CampaignSales(sales2);

            //*************************************************************
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            BaseProperty member = new Member()
            {
                Id = 1, Name = "Kerim", LastName = "Dinçer", NickName = "Nerf KD", DateOfBirth = new DateTime(1992, 9, 6), NationalityId = "11522366578"
            };
            BaseProperty member2 = new Member()
            {
                Id = 2, Name = "Emre", LastName = "Dinçer", NickName = "Nerf ED", DateOfBirth = new DateTime(1991, 4, 1), NationalityId = "11522333556"
            };
            IBaseManager memberManager = new MemberManager(new MernisServiceAdapter());

            memberManager.Add(member);
            memberManager.Add(member2);
            memberManager.List();
            ((Member)member).LastName = "Dinç";
            ((Member)member).Name     = "Ker";
            memberManager.Update(member);
            memberManager.List();
            memberManager.Delete(member2);
            memberManager.List();


            BaseProperty game = new Game()
            {
                Id = 1, Name = "GTA", Price = 350, Type = "RP"
            };
            BaseProperty game2 = new Game()
            {
                Id = 2, Name = "AC", Price = 250, Type = "AC"
            };
            BaseProperty game3 = new Game()
            {
                Id = 3, Name = "PUBG", Price = 90, Type = "BR"
            };
            IBaseManager gameManager = new GameManager();

            gameManager.Add(game);
            gameManager.Add(game2);
            gameManager.Add(game3);
            gameManager.List();
            ((Game)game).Name = "GTAV";
            gameManager.Update(game);
            gameManager.List();
            gameManager.Delete(game3);
            gameManager.List();


            BaseProperty campaign = new Campaign()
            {
                Id = 1, Name = "GTA indirim", CampaignGame = "GTA", Discount = 50
            };
            BaseProperty campaign2 = new Campaign()
            {
                Id = 2, Name = "AC indirim", CampaignGame = "AC", Discount = 50
            };
            IBaseManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign);
            campaignManager.Add(campaign2);
            campaignManager.List();
            ((Campaign)campaign).Name         = "GTAV indirim";
            ((Campaign)campaign).CampaignGame = "GTAV";
            campaignManager.Update(campaign);
            campaignManager.List();
            campaignManager.Delete(campaign2);
            campaignManager.List();

            Sales sale = new Sales()
            {
                Id = 1, MemberId = 1, GameId = 1, CampaingId = 0, PurchasePrice = 0
            };
            Sales sale2 = new Sales()
            {
                Id = 2, MemberId = 1, GameId = 2, CampaingId = 0, PurchasePrice = 0
            };
            SalesManager salesManager = new SalesManager();

            salesManager.Sale(sale);
            salesManager.Sale(sale2);
            salesManager.List();

            Console.ReadLine();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Console.WriteLine("****************** Kimlik Kontrol ****************");

            CustomerTcNoService customerTcNoService = new CustomerTcNoService(new Customer
            {
                CustomerId       = 1,
                CustomerFirsName = "Sefa",
                CustomerLastName = "Demirkıran",
                BirthOfYear      = 1994,
                TcNo             = "12312312312"
            });
            Customer customer1 = new Customer {
                CustomerId = 1, CustomerFirsName = "Hatice", CustomerLastName = "Demirkıran", BirthOfYear = 1960, TcNo = "1122334455667"
            };
            Customer customer2 = new Customer {
                CustomerId = 2, CustomerFirsName = "Ahmet", CustomerLastName = "Demirkıran", BirthOfYear = 1961, TcNo = "1452365214523"
            };
            Customer customer3 = new Customer {
                CustomerId = 3, CustomerFirsName = "Seda", CustomerLastName = "Ucur", BirthOfYear = 1984, TcNo = "12589245245"
            };

            Product product1 = new Product {
                ProductId = 50, ProductName = "Gta", ProductUnitPrice = 299
            };
            Product product2 = new Product {
                ProductId = 51, ProductName = "CsGo", ProductUnitPrice = 399
            };
            Product product3 = new Product {
                ProductId = 52, ProductName = "Forizon", ProductUnitPrice = 199
            };

            Campaign campaign1 = new Campaign {
                CampaingId = 101, CampaingName = "Şahane Pazar", DiscountRate = 10.5
            };
            Campaign campaign2 = new Campaign {
                CampaingId = 102, CampaingName = "Çılgın Cuma", DiscountRate = 9.5
            };
            Campaign campaign3 = new Campaign {
                CampaingId = 103, CampaingName = "Son Fırsat", DiscountRate = 5.5
            };


            CustomerManager customerManager = new CustomerManager();
            ProductManager  productManager  = new ProductManager();
            CampaignManager campaignManager = new CampaignManager();
            SalesManager    sales           = new SalesManager();


            Console.WriteLine("");
            Console.WriteLine("************ Oyuncular **********\n");
            List <Customer> customerList = new List <Customer> {
                customer1, customer2, customer3
            };

            customerManager.GetAll(customerList);

            Console.WriteLine("**************** Oyunlar ************\n");
            List <Product> productsList = new List <Product> {
                product1, product2, product3
            };

            productManager.GetAll(productsList);

            Console.WriteLine("************ Kampanyalar ************\n");
            List <Campaign> campaignsList = new List <Campaign> {
                campaign1, campaign2, campaign3
            };

            campaignManager.GetAll(campaignsList);

            Console.WriteLine("************ Oyuncu Ekle - Oyuncu Sil - Oyuncu Güncelle *********\n");
            Customer customer4 = new Customer {
                CustomerId = 4, CustomerFirsName = "Merve", CustomerLastName = "Akay", BirthOfYear = 1992, TcNo = "125845641865"
            };

            customerManager.Add(customer4);
            Customer customer5 = new Customer {
                CustomerId = 5, CustomerFirsName = "Murat", CustomerLastName = "Kekilli", BirthOfYear = 1971, TcNo = "41845444845"
            };

            customerManager.Add(customer5);

            customerManager.Delete(customer3);
            _ = new Customer {
                CustomerId = 2, CustomerFirsName = "Sercan", CustomerLastName = "Yımaz", BirthOfYear = 1993, TcNo = "5150210620"
            };
            customerManager.Update(customer2);

            Console.WriteLine("");
            Console.WriteLine("**************** Oyun Ekle - Oyun Sil - Oyun Güncelle ***************");

            Product product4 = new Product {
                ProductId = 4, ProductName = "Pubg", ProductUnitPrice = 199
            };

            productManager.Add(product4);

            productManager.Delete(product2);
            productManager.Update(product1);
            Console.WriteLine("");

            Console.WriteLine("************* Kampanya Güncelleme ***********\n");

            campaignManager.Update(campaign1);
            Console.WriteLine("");

            Console.WriteLine("******* İndirim Uygulama *********\n");
            sales.ApplyDiscount(product1, campaign3);
        }