Example #1
0
        private static decimal calculateSizeCost(OrderDTO order, papaBobs.DTO.PizzaPriceDTO prices)
        {
            decimal cost = 0.0M;


            switch (order.size)
            {
            case papaBobs.DTO.Enums.SizeType.Small:
                cost = prices.SmallSizeCost;
                break;

            case papaBobs.DTO.Enums.SizeType.Medium:
                cost = prices.MediumSizeCost;
                break;

            case papaBobs.DTO.Enums.SizeType.Large:
                cost = prices.LargeSizeCost;
                break;

            default:
                break;
            }


            return(cost);
        }
Example #2
0
        private static decimal calculateToppingsCost(OrderDTO order, papaBobs.DTO.PizzaPriceDTO prices)
        {
            decimal cost = 0.0M;

            cost += (order.sausage) ? prices.SauasgeCost : 0M;
            cost += (order.pepperoni) ? prices.PepperoniCost : 0M;
            cost += (order.onions) ? prices.OnionCost : 0M;
            cost += (order.greenPeppers) ? prices.GreenPepperCost : 0M;

            return(cost);
        }