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) { PlayersDB player1 = new PlayersDB(); player1.Adi = "Burak"; player1.Soyadi = "Elmas"; player1.TcNo = "11239058561"; player1.DYili = "1995"; PlayersDB player2 = new PlayersDB(); player2.Adi = "Ahmet"; player2.Soyadi = "Sevinç"; player2.TcNo = "11232658561"; player2.DYili = "1975"; PlayersDB player3 = new PlayersDB(); player3.Adi = "Seda"; player3.Soyadi = "Pınar"; player3.TcNo = "1123265851"; player3.DYili = "1995"; MemberManager memberManager = new MemberManager(); Console.WriteLine("--Üye İşlemleri--"); Console.WriteLine(" "); memberManager.Add(player1); memberManager.Add(player3); memberManager.Delete(player2); memberManager.Update(player1); CampaignsDB campaign1 = new CampaignsDB(); campaign1.CampaignId = 1; campaign1.Adi = "Yılbaşı"; campaign1.SonGunu = "5 Ocak 2021"; CampaignsDB campaign2 = new CampaignsDB(); campaign2.CampaignId = 2; campaign2.Adi = "Muhteşem Cuma"; campaign2.SonGunu = "15 Mart 2021"; CampaignsDB campaign3 = new CampaignsDB(); campaign3.CampaignId = 3; campaign3.Adi = "Şahane Ocak"; campaign3.SonGunu = "30 Ocak 2021"; CampaignManager campaignManager = new CampaignManager(); Console.WriteLine(" "); Console.WriteLine("--Kampanya İşlemleri--"); Console.WriteLine(" "); campaignManager.Add(campaign1); campaignManager.Delete(campaign2); campaignManager.Update(campaign3); GameDB game1 = new GameDB(); game1.GameId = 678; game1.OyunAdi = "Call Of Duty"; game1.Fiyat = "400"; game1.CampaignId = 2; GameDB game2 = new GameDB(); game2.GameId = 452; game2.OyunAdi = "Civilizations 5"; game2.Fiyat = "80"; game2.CampaignId = 1; GameManager gameManager = new GameManager(); Console.WriteLine(" "); Console.WriteLine("--Oyun İşlemleri--"); Console.WriteLine(" "); gameManager.Add(game1); gameManager.Delete(game2); gameManager.Update(game1); SalesManager salesManager = new SalesManager(); Console.WriteLine(" "); Console.WriteLine("--Satış İşlemleri--"); Console.WriteLine(" "); salesManager.Sales(player1, game1); salesManager.SalesCancel(player2, game2); }
static void Main(string[] args) { Member member1 = new Member(); member1.Id = 1; member1.TcNo = "11111111111"; member1.FirstName = "Ali"; member1.LastName = "Can"; member1.DateOfBirth = new DateTime(1996, 10, 2); Member member2 = new Member() { Id = 2, TcNo = "2222222222", FirstName = "Mehmet", LastName = "Can", DateOfBirth = new DateTime(1999, 10, 29) }; MemberManager memberManager = new MemberManager(new MernisServiceAdapter()); Console.WriteLine("MemberManager"); memberManager.Add(member1); memberManager.Delete(member1); memberManager.Update(member1); Console.WriteLine("------------------------------------"); SteamMemberManager steamMemberManager = new SteamMemberManager(new MernisServiceAdapter()); Console.WriteLine("SteamMemberManager"); steamMemberManager.Add(member2); steamMemberManager.Delete(member2); steamMemberManager.Update(member2); Console.WriteLine("------------------------------------"); EpicMemberManager epicMemberManager = new EpicMemberManager(new MernisServiceAdapter()); Console.WriteLine("EpicMemberManager"); epicMemberManager.Add(member2); epicMemberManager.Delete(member2); epicMemberManager.Update(member2); Console.WriteLine("------------------------------------"); Game game1 = new Game() { Id = 1, GameName = "ETS2", Price = 38 }; GameManager gameManager = new GameManager(); gameManager.Add(game1); gameManager.Delete(game1); gameManager.Update(game1); Campaign campaign1 = new Campaign() { Id = 1, CampaignName = "Yıl Başı", CampaignType = "İndirim" }; CampaignManager campaignManager = new CampaignManager(); campaignManager.Add(campaign1); campaignManager.Delete(campaign1); campaignManager.Update(campaign1); OrderManager orderManager = new OrderManager(); //Kampanyasız orderManager.Sale(member1, game1); //Kampanyalı orderManager.Sale(member2, game1, campaign1); }
static void Main(string[] args) { GameManager gameManager = new GameManager(); CampaignManager campaignManager = new CampaignManager(); MemberManager memberManager = new MemberManager(); SalesManager salesManager = new SalesManager(); //bütün managerleri oluşturduk. Game game1 = new Game() { gameName = "Assassin's Creed Odyssey", gameCategory = 1, gamePrice = 99 }; Game game2 = new Game() { gameName = "The Witcher 3 Wild Hunt", gameCategory = 2, gamePrice = 29 }; Campaign campaign = new Campaign(); campaign.campaignName = "Black Friday"; campaign.campaignDiscount = 50;//yüzde olarak bu rakamı indirim hesaplamada kullanacağız NewMember newMember = new NewMember() { Id = 0001, Age = 25, Name = "Muhammed", Surname = "Argin", TcNo = "1111111111", whoRecommended = "Engin Demiroğ" }; OldMember oldMember = new OldMember() { Id = 0002, Age = 23, Name = "Zeynep", Surname = "Argin", TcNo = "222222222", registrationDate = "01/01/2021" }; Console.WriteLine("----------------------"); gameManager.Add(game1); gameManager.Add(game2); gameManager.List(); gameManager.Delete(game2); gameManager.List(); // oyun ekleme ve silme işlemleri gerçekleştirildi Console.WriteLine("------------------"); memberManager.Add(newMember); memberManager.Add(oldMember); memberManager.List(); memberManager.Delete(oldMember); memberManager.List(); // üye ekleme ve silme işlemleri gerçekleştirildi Console.WriteLine("------------------"); salesManager.SalesInformation(game1, campaign, newMember); }