public void SaveProduct(ProductServiceEditProductResponse request)
        {
            ProductServiceSaveProductAdapter productAdapter = new ProductServiceSaveProductAdapter(request.Product);

            if (request.Product.ProductId > 0)
                _unitOfWork.Products.Update(productAdapter.Fill());
            else _unitOfWork.Products.Add(productAdapter.Fill());
            _unitOfWork.Commit();
        }
 public ActionResult EditProduct(ProductServiceEditProductResponse response)
 {
     if (ModelState.IsValid)
     {
         _productService.SaveProduct(response);
         TempData["message"] = string.Format("{0} has been saved", response.Product.Name);
         return RedirectToAction("ListProducts");
     }
     else
     {
         return View(response);
     }
 }
        public ProductServiceEditProductResponse Fill()
        {
            var productDto = new StefanStoreDTO.ProductDto.ProductDto();

            productDto.ProductId = _product.ProductID;
            productDto.Price = _product.Price;
            productDto.Name = _product.Name;
            productDto.Description = _product.Description;
            productDto.Category = _product.Category;

            ProductServiceEditProductResponse response = new ProductServiceEditProductResponse
            {
                Product = productDto
            };

            return response;
        }