예제 #1
0
        public ProductDTO CreateProductDTO(ProductService.ProductDTO product)
        {
            ProductDTO result = new ProductDTO()
            {
                Name      = product.Name,
                ProductID = product.ProductID,
                ListPrice = product.ListPrice
            };

            return(result);
        }
예제 #2
0
        public RedirectToRouteResult RemoveFromCart(ShopCartItemServiceClient cart, int productId, string returnUrl)
        {
            Factory factory = new Factory();

            ProductService.ProductDTO product = productService.GetProduct(productId);
            var productDTO = factory.CreateProductDTO(product);


            if (productDTO != null)
            {
                cart.RemoveLine(productDTO);
            }
            return(RedirectToAction("Index", new { returnUrl }));
        }