private void ChangesOverTime() { if (_availabilityProducts.RemovingSpoiledProducts()) { Console.WriteLine("Испорченные продукты были удалены"); } List <ConsumedCommodity> products = _consumptionProducts.RecommendedProducts(); if (products.Count == 0) { return; } List <Commodity> goods = new List <Commodity>(); foreach (var i in products) { goods.Add(new Commodity(i.Product, i.Weight, DateTime.Today)); } var recommendations = new ListCategoriesCommodity(_availabilityProducts.Date); foreach (var i in _availabilityProducts.GetCommodityAll()) { recommendations.Add(new Commodity(i.Product, i.Weight, i.ExpiryDate)); } if (!recommendations.ChangeOverTime(goods)) { return; } Console.WriteLine("Возможные изменения доступных продуктов:"); recommendations.Print(true); Console.WriteLine($"Сохранить изменения?(Y/)"); string cmd = Console.ReadLine(); if (cmd == "Y" || cmd == "y") { _availabilityProducts = recommendations; } _availableRecipes.ProductСhanges = true; }