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
        /// <summary>
        /// send a product oredr 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 enmail of the current</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.No)
            {
                orderText += " With Copy";
            }
            var operationalResult = new OperationResult(true, orderText);

            return(operationalResult);
        }
Beispiel #3
0
        /// <summary>
        /// Sends product order to the vendor.
        /// </summary>
        /// <param name="product">Ordered product.</param>
        /// <param name="quantity">Ordered quantity.</param>
        /// <param name="address">"True" to include shipping address.</param>
        /// <param name="copy">"True" to send email copy.</param>
        /// <returns>Success flag and order text.</returns>
        public OperationResult PlaceOrder(Product product, int quantity,
                                          IncludeAddress theAddress,
                                          SendCopy theCopy)
        {
            var orderText = "Test";

            if (theAddress == IncludeAddress.yes)
            {
                orderText += " With address";
            }
            if (theCopy == SendCopy.yes)
            {
                orderText += " With copy";
            }

            var operationResult = new OperationResult(true, orderText);

            return(operationResult);
        }
Beispiel #4
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));
        }