/// <summary>
        /// Process video request order
        /// </summary>
        /// <param name="order"></param>
        public void ProcessOrder(IOrder order)
        {
            try
            {
                if (order == null)
                {
                    throw new Exception("Order is null");
                }

                Video video = (Video)order;

                Console.WriteLine("\n\t\t** PROCESSING ORDER ID : {0}\n", video.OrderId);
                Console.WriteLine("\n\t\t** PROCESSING order placed for {0} video : ", video.VideoType);
                if (video.VideoType.Equals(VideoType.LEARNING))
                {
                    _orderExecutionService.SendFreeVideo();
                }

                PrintVideoDetails(video.VideoDetails);
                _orderExecutionService.CreatePackingSlip();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            Console.WriteLine("\n\t\t*********************************************\n");
        }
예제 #2
0
        /// <summary>
        /// Process product request
        /// </summary>
        /// <param name="order"></param>
        public void ProcessOrder(IOrder order)
        {
            try
            {
                if (order == null)
                {
                    throw new Exception("Order is null");
                }
                Product product = (Product)order;
                Console.WriteLine("\n\t\t** PROCESSING ORDER ID : {0}\n", product.OrderId);
                Console.WriteLine("\n\t\t** PROCESSING order placed for {0} product type : ", product.ProductType);
                if (product.ProductType.Equals(ProductType.PHYSICAL))
                {
                    _orderExecutionService.CreatePackingSlip();
                }
                else
                {
                    _orderExecutionService.CreateDuplicateSlip();
                }

                PrintProductDetails(product.ProductDetails);
                _orderExecutionService.GenerateAgentCommission();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            Console.WriteLine("\n\t\t*********************************************\n");
        }