Пример #1
0
        public OrderView GetOrder(int targetId, OrderTypeEnum orderType)
        {
            var orderTypeStrategy = OrderTypeFactory.GetOrderTypeStrategy(orderType);
            var order             = orderTypeStrategy.GetOrderReview(targetId);

            order.Total = order.OrderDetails.Sum(x => x.Product.Price * x.Quantity);
            return(order);
        }
Пример #2
0
        public void ChechoutOrder(OrderView order)
        {
            var orderTypeStrategy = OrderTypeFactory.GetOrderTypeStrategy((OrderTypeEnum)order.OrderTypeInt);

            orderTypeStrategy.CheckoutOrder(order);
        }