static void Main(string[] args) { //Üyelik Adımı Member member = new Member { Id = 1, FirstName = "Melike", LastName = "Özbey", DateOfBirth = new DateTime(1994, 1, 14), IdentityNumber = "11111111111", Password = "******" }; BaseMemberManager memberManager = new MemberManager(new MemberValidationManager()); memberManager.Add(member); BaseMemberManager memberManager2 = new MemberManager(new MernisServiceAdapter()); memberManager2.Add(member); //Kampanya Ekle-Sil-Güncelle Campaign campaign = new Campaign { Id = 1, CampaignName = "Muhteşem haftasonu", Detail = "sepette %50 indirim" }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign); //campaignManager.Delete(campaign.Id); //campaignManager.Update(campaign.Id); //Satış ve kampanya //1- Üye oyunu seçer Sale sale = new Sale { Id = 1, GameName = "LOL", Price = 200 }; //2- Kampanya seçimi if (campaign != null) { ICampaignService discountCampaign = new DiscountCampaingManager(); discountCampaign.Apply(campaign, sale); } else { SaleManager saleManager = new SaleManager(); saleManager.Buy(sale, member); } }
static void Main(string[] args) { CustomerManager customerManager = new CustomerManager(); Customer customer1 = new Customer() { FirstName = "Hazin", LastName = "Yıldırım", DateOfBirth = new DateTime(1964, 3, 23), Id = 4, NationalityId = "147963258" }; Customer customer2 = new Customer() { FirstName = "Buket", LastName = "Erol", DateOfBirth = new DateTime(1990, 9, 26), Id = 2, NationalityId = "18954712" }; customerManager.Save(customer1); customerManager.Update(customer2); CampaignManager campaignManager = new CampaignManager(); Campaign campaign = new Campaign(); campaign.CampaignCode = "154896"; campaign.CampaignName = "Ocak indirimi"; campaign.CampaignDiscount = 50; campaignManager.Add(campaign); Game game1 = new Game(); game1.GameName = "Football Manager"; game1.GameType = "Sport"; game1.GamePrice = 260; Game game2 = new Game(); game2.GameName = "Call Of Duty"; game2.GameType = "FPS"; game2.GamePrice = 150; SaleManager saleManager = new SaleManager(); saleManager.Sale(customer2, game1); CampaignSaleManager campaignSaleManager = new CampaignSaleManager(); campaignSaleManager.CampaignSale(campaign, game2); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new MernisServiceAdapter()); Gamer gamer = new Gamer(); // kendi bilgilerinizi girerek deneyebilirsiniz... gamer.DateOfBirth = new DateTime(1999, 2, 17); gamer.FirstName = "esra"; gamer.LastName = "çetintaş"; gamer.NationalyId = "11111111111"; gamer.Mail = "*****@*****.**"; gamerManager.Add(gamer); Game game = new Game(); game.GameId = 123456; game.GameName = "Uzay Oyunu"; game.GamePrice = 19.99f; GameManager gameManager = new GameManager(); gameManager.Add(game); Campaign campaign = new Campaign(); campaign.CampaignId = 135790; campaign.CampaignName = "Son fırsatlar"; campaign.CampaignDiscout = 20; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign); campaign.CampaignDiscout = 30; campaignManager.Update(campaign); SaleManager sale = new SaleManager(); sale.Sale(gamer, game); sale.CampaignSale(gamer, game, campaign); Console.ReadKey(); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new GamerCheckManager()); Gamer gamer1 = new Gamer { Id = 1, FirstName = "İREM", LastName = "DİLİK", BirthYear = 2001, IdentityNumber = 12345678910 }; gamerManager.Add(gamer1); gamerManager.Update(gamer1); gamerManager.Delete(gamer1); GameManager gameManager = new GameManager(); Game game1 = new Game { Name = "LOL", Price = 50 }; gameManager.Add(game1); gameManager.Update(game1); gameManager.Delete(game1); CampaignManager campaignManager = new CampaignManager(); Campaign campaign1 = new Campaign { Name = "Kış İndirimi", Percentage = 25 }; campaignManager.Add(campaign1); campaignManager.Delete(campaign1); campaignManager.Update(campaign1); SaleManager saleManager = new SaleManager(); saleManager.CampaignSale(gamer1, game1, campaign1); saleManager.GameSale(gamer1, game1); }
static void Main(string[] args) { Gamer gamer1 = new Gamer { Id = 1, BirthYear = 1981, FirstName = "Derya", LastName = "Üçüncü", IdentityNumber = 567432189 }; GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(gamer1); Campaign campaign1 = new Campaign { Id = 1, Name = "Kampanya1" }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign1); Game game1 = new Game { Id = 1, Name = "Oyun1", Price = 30, Stock = 50 }; GameManager gameManager = new GameManager(); gameManager.Add(game1); ISaleService sale = new SaleManager(); sale.CampaignSale(campaign1, game1, gamer1); }
static void Main(string[] args) { Gamer gamer1 = new Gamer { Id = 1, BirthYear = 1998, FirstName = "Samet", LastName = "Vural", IdentityNumber = 12345 }; Gamer gamer2 = new Gamer { Id = 2, BirthYear = 1997, FirstName = "Sezer", LastName = "Bozbıyık", IdentityNumber = 12345 }; GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(gamer1); gamerManager.Add(gamer2); gamerManager.Add(gamer1); Game game1 = new Game { GameName = "Counter Strike", GamePrice = 150 }; Game game2 = new Game { GameName = "Pubg", GamePrice = 250 }; Campaign campaign1 = new Campaign { CampaignId = 1, CampaignName = "Yaz", CampaignDiscount = 10 }; Campaign campaign2 = new Campaign { CampaignId = 2, CampaignName = "Kış", CampaignDiscount = 5 }; SaleManager saleManager = new SaleManager(); saleManager.CampaignSale(game1, gamer2, campaign2); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(new Gamer { IdentityNumber = 1, BirthYear = 1997, Firstname = "Edanur", Lastname = "Turhan", Id = 1 }); GamerManager gamerManager1 = new GamerManager(new UserValidationManager()); gamerManager1.Add(new Gamer { IdentityNumber = 2, BirthYear = 1997, Firstname = "Esma", Lastname = "Altun", Id = 2 }); Campaign campaign = new Campaign { Id = 1, CampaignName = "Efsane Cuma", Detail = "sepette %70 indirim" }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign); Sale sale = new Sale { Id = 1, GameName = "GTA", Price = 200 }; if (campaign != null) { ICampaignService discountCampaign = new DiscountCampaignManager(); discountCampaign.Apply(campaign, sale); } else { SaleManager saleManager = new SaleManager(); saleManager.Buy(sale, gamer); } }
static void Main(string[] args) { Game game1 = new Game(); game1.Id = 1; game1.GameName = "Total War"; game1.GameType = "Strateji"; Gamer gamer = new Gamer(); gamer.Id = 1; gamer.FirstName = "AYDIN"; gamer.LastName = "TUZ"; gamer.IdentityNumber = 11111111111; gamer.BirthYear = 1986; GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(gamer); Campaign campaign1 = new Campaign(); campaign1.CampaignId = 1; campaign1.CampaignName = "Sevgililer Günü Özel"; campaign1.DiscountRate = 0.25; campaign1.StartDate = new DateTime(2021, 2, 14); campaign1.EndDate = new DateTime(2021, 2, 17); CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign1); campaignManager.Update(campaign1); campaignManager.Delete(campaign1); SaleManager saleManager = new SaleManager(campaign1); saleManager.Sale(game1, gamer); }
static void Main(string[] args) { // Oyuncu eklenmesi Gamer gamer1 = new Gamer() { Id = 1, FirstName = "Ahmet Efecan", LastName = "Bayat", DateOfBirth = new DateTime(1997, 1, 1), NationalityId = "TcKimlikNo giriniz" }; GamerManager gamerManager = new GamerManager(new MernisServiceAdapter()); gamerManager.SignUp(gamer1); // Oyun eklenmesi Game game1 = new Game() { Id = 1, Name = "CSGO", Price = 50 }; GameManager gameManager = new GameManager(); gameManager.Add(game1); //Kampanya eklenmesi Campaign campaign1 = new Campaign() { Id = 1, Name = "Black Friday", DiscountRate = 30 }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign1); // Satış yapılması SaleManager saleManager = new SaleManager(); saleManager.Sale(game1, gamer1, campaign1); }
static void Main(string[] args) { Gamer gamer1 = new Gamer { FirstName = "Merve", LastName = "Kardeş", TcNo = "12345678910", YearOfBirth = 1998 }; Gamer gamer2 = new Gamer { FirstName = "Meral", LastName = "Kardeş", TcNo = "12345678911", YearOfBirth = 1993 }; Game game1 = new Game { Id = 1, Name = "Fifa", Price = 100 }; Game game2 = new Game { Id = 2, Name = "Monopoly", Price = 200 }; Campaign campaign = new Campaign { Id = 1, Name = "Black Friday" }; GamerManager gamerManager = new GamerManager(new UserValidationManager()); gamerManager.Add(gamer1); gamerManager.Add(gamer2); SaleManager saleManager = new SaleManager(); saleManager.GameSale(game1, gamer1, campaign); }
static void Main(string[] args) { Gamer gamer1 = new Gamer() { Id = 1, FirstName = "Ali", LastName = "Yılmaz", NationalityId = "123213553", DateOfBirth = new DateTime(2005, 12, 1) }; Gamer gamer2 = new Gamer() { Id = 2, FirstName = "Yeşim", LastName = "Sanar", NationalityId = "456897654", DateOfBirth = new DateTime(2004, 5, 6) }; GamerManager gamerManager = new GamerManager(); gamerManager.Save(gamer1); Game game1 = new Game() { Id = 1, Name = "Grand Theft Auto:San Andreas", Price = 19.75 }; Game game2 = new Game() { Id = 2, Name = "Undertale", Price = 28.75 }; SaleManager sale = new SaleManager(); sale.Sale(gamer2, game1); Campaign campaign1 = new Campaign() { Id = 1, Name = "New Year Campaign", StartingDate = new DateTime(2020, 12, 24), EndDate = new DateTime(2021, 1, 2) }; Campaign campaign2 = new Campaign() { Id = 2, Name = "Valentine's Day", StartingDate = new DateTime(2021, 2, 7), EndDate = new DateTime(2021, 2, 17) }; SaleManager sale2 = new SaleManager(); sale2.CampaignSale(campaign1, game2, gamer1); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new MerniseServiceAdapter()); Gamer gamer = new Gamer() { Id = 1, FirstName = "Merve Büşra", LastName = "Durmuş", NationalityId = "1111111111111", DateOfBirth = new DateTime(1995, 8, 20) }; gamerManager.Save(gamer); gamerManager.Delete(gamer); gamerManager.Update(gamer); GameManager gameManager = new GameManager(); Game game = new Game() { Id = 1, GameName = "DOOM", GamePrice = 100, GameDescription = "Doom is a first-person shooter presented with early 3D graphics." }; gameManager.Add(game); gameManager.Delete(game); gameManager.Update(game); CampaignManager campaignManager = new CampaignManager(); Campaign campaign = new Campaign() { Id = 1, CampaignName = "Doom campaign 1", CampaignDiscount = 10 }; campaignManager.Add(campaign); campaignManager.Delete(campaign); campaignManager.Update(campaign); SaleManager saleManager = new SaleManager(); saleManager.Sale(gamer, game); saleManager.CampaignSale(game, gamer, campaign); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new MernisServiceAdapter()); Gamer gamer = new Gamer //gamer information { Id = 1, FirstName = "Şeyma Nur", LastName = "Terzioğlu", NationalityId = "12345", BirthYear = 1998 }; gamerManager.Add(gamer); //GamerManager's method used gamerManager.Update(gamer); gamerManager.Delete(gamer); Game game = new Game //game information { GameId = 1, GameName = "Attack on Titan / A.O.T. Wings of Freedom", GamePrice = "170TL" }; Campaign campaign = new Campaign //campaign information { CampaignId = 1, CampaignName = "8 Mart Kadınlar Günü Kampanyası", CampaignDiscount = "%40" }; SaleManager saleManager = new SaleManager(); saleManager.Sale(gamer, game); //SaleManager 's method used saleManager.CampaignSale(gamer, game, campaign); }
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); }
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); } } }
static void Main(string[] args) { //Game Game game = new Game(); game.Id = 1; game.GameName = "Battlefield"; game.GamePrice = 180; Game game2 = new Game(); game.Id = 2; game.GameName = "Pummel Party"; game.GamePrice = 26; GameManager gameManager = new GameManager(); gameManager.Add(game); //Campaign Campaign campaign = new Campaign(); campaign.Id = 1; campaign.CampaignName = "Cyber Monday"; campaign.DiscountRate = 35; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign, game); //Gamer Gamer gamer = new Gamer(); gamer.Id = 1; gamer.FirstName = "İrem"; gamer.LastName = "Üstün"; gamer.NationalityId = "1234567890"; gamer.DateOfBirth = new DateTime(1998, 2, 4); Gamer gamer2 = new Gamer(); gamer2.Id = 2; gamer2.FirstName = "Ayşegül"; gamer2.LastName = "Üstün"; gamer2.NationalityId = "9087654321"; gamer2.DateOfBirth = new DateTime(1991, 10, 4); GamerManager gamerManager = new GamerManager(new GamerValidationManager()); gamerManager.Save(gamer); gamerManager.Update(gamer2); //Sales Sale sale = new Sale(); sale.SaleId = 1; sale.SaleDateTime = DateTime.Now; SaleManager saleManager = new SaleManager(); saleManager.Buy(gamer, game, campaign, sale); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new MernisServiceAdapter()); gamerManager.Add(new Gamer { DateOfBirth = new DateTime(1998, 05, 28), FirstName = "Rumeysa", LastName = "Koçak", NationalityId = "564644" }); Game game1 = new Game() { GameId = 1, GameName = "CS:GO", GamePrice = 600 }; Game game2 = new Game() { GameId = 2, GameName = "LOL", GamePrice = 580 }; Game game3 = new Game() { GameId = 3, GameName = "PUBG", GamePrice = 700 }; Game game4 = new Game() { GameId = 4, GameName = "AMONG US", GamePrice = 850 }; Campaign campaign1 = new Campaign() { CampaignName = "New Member Campaign", DiscountRate = 25, CampaignId = 3 }; Campaign campaign2 = new Campaign() { CampaignName = "Valentines Day Campaign", DiscountRate = 40, CampaignId = 4 }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign2); campaignManager.Add(campaign1); campaignManager.Delete(campaign1); campaignManager.Delete(campaign2); campaignManager.Update(campaign1); campaignManager.Update(campaign2); Sale sale1 = new Sale() { GameId = 1, CampaignId = 1 }; Sale sale2 = new Sale() { GameId = 3, CampaignId = 2 }; SaleManager saleManager = new SaleManager(); saleManager.Add(sale2); saleManager.Add(sale1); saleManager.Delete(sale2); saleManager.Delete(sale1); saleManager.Update(sale1); saleManager.Update(sale2); Console.ReadLine(); }
static void Main(string[] args) { GamerManager gamerManager = new GamerManager(new NewEStateUserValidationSystem()); gamerManager.Add(new Gamer { Id = 1, UserName = "******", FirstName = "Ahmet", LastName = "Yoldaş", BirthYear = "1999", IdentityNumber = 0123456, Password = "******", }); gamerManager.Add(new Gamer { Id = 2, UserName = "******", FirstName = "RUMEYSA ", LastName = "ÖZDEMİR", BirthYear = "1994", IdentityNumber = 12345, Password = "******" });; Game game1 = new Game() { Id = 1, Name = "Hitman 2", Price = 79.90 }; Game game2 = new Game() { Id = 2, Name = "Assassin's Creed 2 Brotherhood", Price = 54.90 }; GameManager gameManager = new GameManager(); gameManager.Add(game1); gameManager.Add(game2); SpecialOffer specialOffer1 = new SpecialOffer() { Id = 1, Name = "Büyük Cuma Kampanyası", DiscountRate = 15 }; SpecialOffer specialOffer2 = new SpecialOffer() { Id = 2, Name = "Dev Teknoloji Kampanyası", DiscountRate = 20 }; SpecialOfferManager specialOfferManager = new SpecialOfferManager(); specialOfferManager.Add(specialOffer1); specialOfferManager.Add(specialOffer2); Gamer gamer1 = new Gamer() { Id = 1, IdentityNumber = 0123456, FirstName = "Ahmet", LastName = "Yoldaş", BirthYear = "1999", UserName = "******", Password = "******" }; SaleManager saleManager = new SaleManager(); saleManager.Sale(gamer1, game1); saleManager.DiscountedSale(gamer1, game2, specialOffer2); }