示例#1
0
        public string PlaceOrder(int customerId, long productId, int quantity)
        {
            OrderValidator.EnsureOrderParameters(customerId, productId, quantity);
            EnsureProductIsSupported(productId);
            var orderNumber = DataFacade.PlaceOrder(customerId, productId, quantity);

            WarehouseServiceGateway.Ship(orderNumber);
            Emailer.SendEmail(customerId, subject: "Order Confirmation", body: "Your order: " + orderNumber + ", has been received and confirmed. The shipment is on its way!");
            return(orderNumber);
        }