static void Main(string[] args) { //Oyuncu Kayıt, Güncelleme, Silme BaseUserManager basketballGameUserManager = new BasketballGameUserManager(); BaseUserManager soccerGameUserManager = new SoccerGameUserManager(new MernisServiceAdapter()); User user1 = new User { Id = 1, FirstName = "Berk", LastName = "Canbaz", DateOfBirth = new DateTime(1998, 3, 26), NationalityId = "35395733738" }; User user2 = new User { Id = 2, FirstName = "Mehmet", LastName = "Boyraz", DateOfBirth = new DateTime(1998, 5, 18), NationalityId = "19889228740" }; basketballGameUserManager.Save(user2); basketballGameUserManager.Update(user2); basketballGameUserManager.Delete(user2); soccerGameUserManager.Save(user1); soccerGameUserManager.Update(user1); soccerGameUserManager.Delete(user1); //Satın Alma, İade Etme BaseMarketManager marketManager = new BaseMarketManager(); GameProducts product1 = new GameProducts { Name = "Kırmızı Futbol Topu", Price = 250 }; marketManager.Buy(product1, user1); marketManager.Return(product1, user1); //Kampanya Ekleme, Güncelleme, Silme, Ürün ile Entegrasyon BaseCampaignManager campaignManager = new BaseCampaignManager(); Campaigns campaign1 = new Campaigns { Campaign = "İki kırmızı top alımında ikincisi yarı fiyatına." }; campaignManager.Add(campaign1, product1); campaignManager.Update(campaign1, product1); campaignManager.Delete(campaign1, product1); }
public void UpdateGameProduct(int productID, string name, decimal price, int quantity, GameProductType gameType, int yearOfRelease, int recommendedAge, int supplierID) { GameProduct productToUpdate = GameProducts.FirstOrDefault(p => p.ProductID == productID); if (productToUpdate != null) { productToUpdate.Name = name; productToUpdate.Price = price; productToUpdate.Quantity = quantity; productToUpdate.GameType = gameType; productToUpdate.YearOfRelease = yearOfRelease; productToUpdate.RecommendedAge = recommendedAge; productToUpdate.SupplierID = supplierID; } }
public void AddGameProduct(string name, decimal price, int quantity, GameProductType gameType, int yearOfRelease, int recommendedAge, int supplierID) { GameProduct newProduct = new GameProduct { Name = name, Price = price, Quantity = quantity, GameType = gameType, YearOfRelease = yearOfRelease, RecommendedAge = recommendedAge, SupplierID = supplierID }; GameProducts.Add(newProduct); }
public void Buy(GameProducts product, User user) { Console.WriteLine("Ürün başarıyla satın alındı: " + product.Name + "\nÜrün Tutarı: " + product.Price); }
public void Return(GameProducts product, User user) { Console.WriteLine("Ürün başarıyla iade edildi: " + product.Name + "\nİade Tutarı: " + product.Price); }
public void Add(Campaigns campaign, GameProducts product) { Console.WriteLine("'" + campaign.Campaign + "' kampanyası \n'" + product.Name + "' ürününe başarıyla eklendi."); }
public void Delete(Campaigns campaign, GameProducts product) { Console.WriteLine("'" + campaign.Campaign + "' kampanyası \n'" + product.Name + "' ürününden başarıyla kaldırıldı."); }
public void Update(Campaigns campaign, GameProducts product) { Console.WriteLine("'" + campaign.Campaign + "' kampanyası \n'" + product.Name + "' ürününde başarıyla güncellendi."); }