Example #1
0
        private bool ProductFitsConfigured(List <DimensionValues> productDimensions,
                                           ConfiguredDimension configuredDimension)
        {
            foreach (var dimensions in productDimensions)
            {
                bool validateHeight = Validate(dimensions.PossibleHeights, configuredDimension.Height);
                bool validateWidth  = Validate(dimensions.PossibleWidths, configuredDimension.Width);
                bool validateDepth  = Validate(dimensions.PossibleDepths, configuredDimension.Depth);

                if (validateDepth && validateHeight && validateWidth)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
        private float CalculatePriceValue(Price finishPrice, Price materialPrice, Price productPrice, ConfiguredDimension configuredDimension)
        {
            var height    = Conversor.MilimeterToMeter(configuredDimension.Height);
            var width     = Conversor.MilimeterToMeter(configuredDimension.Width);
            var depth     = Conversor.MilimeterToMeter(configuredDimension.Depth);
            var totalArea = (2 * (height * depth)) + (2 * (width * depth)) + (height * width);

            return(totalArea * (materialPrice.Value + finishPrice.Value) + productPrice.Value);
        }