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 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; } }