Пример #1
0
        public static int ValueOf(IBox box, string color)
        {
            var oneColorFlowers = box.GetFlowerList()
                                  .Where(x => x.GetFlowerColor().ToUpper() == color.ToUpper())
                                  .ToList();

            var priceList = PriceList.GetInstance();

            int value = 0;

            foreach (var item in oneColorFlowers)
            {
                value += priceList.GetFlowerCharge(item);
            }

            return(value);
        }