Beispiel #1
0
        /// <summary>
        /// Sends a product order to the vendor.
        /// </summary>
        /// <param name="product">Product to order.</param>
        /// <param name="quantity">Quantity of the product to order.</param>
        /// <param name="includeAddress">True to include the shipping address in the order.</param>
        /// <param name="sendCopy">True to send a copy of the email to the current user.</param>
        /// <returns>Success flag and order text</returns>
        public OperationResult PlaceOrder(Product product, int quantity,
                                          IncludeAddress includeAddress, 
                                          SendCopy sendCopy)
        {
            var orderText = "Test";
            if (includeAddress == IncludeAddress.Yes) orderText += " With Address";
            if (sendCopy == SendCopy.Yes) orderText += " With Copy";

            var operationResult = new OperationResult(true, orderText);
            return operationResult;
        }
Beispiel #2
0
        public OperationResult PlaceOrder(Product product, int quantity,
                                          IncludeAddress includeAddress, SendCopy sendCopy)
        {
            var orderText = "Test";

            if (includeAddress == IncludeAddress.Yes)
            {
                orderText += " With Address";
            }
            if (sendCopy == SendCopy.Yes)
            {
                orderText += " With Copy";
            }

            var operationResult = new OperationResult(true, orderText);

            return(operationResult);
        }
Beispiel #3
0
        /// <summary>
        /// Send a product order to the vendor.
        /// </summary>
        /// <param name="product">Product to order.</param>
        /// <param name="quantity">Quantity of the product to order.</param>
        /// <param name="includeAddress">True to include the shipping address.</param>
        /// <param name="sendCopy">True to send a copy of the email</param>
        /// <returns>Success flag and order text.</returns>
        public OperationResult PlaceOrder(Product product, int quantity, IncludeAddress includeAddress, SendCopy sendCopy)
        {
            if (product == null)
            {
                throw new ArgumentNullException(nameof(product));
            }
            if (quantity <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(quantity));
            }

            var orderText = "Test";

            if (includeAddress == IncludeAddress.yes)
            {
                orderText += " With Address";
            }
            if (sendCopy == SendCopy.yes)
            {
                orderText += " With Copy";
            }

            return(new OperationResult(true, orderText));
        }