Beispiel #1
0
        static void Main(string[] args)
        {
            IProductViewService service = new ProductViewService();

            var a = service.GetProductByGems(false);
            var b = service.GetProductById(1);
            var c = service.GetProductByType(1);
        }
Beispiel #2
0
 public ProductSection(DataGridView dataGridView, IPresenter presenter, ISearchProductView form)
 {
     ViewService      = new ProductViewService(dataGridView, form);
     ProductDbService = new ProductDbService();
     CategoryService  = new CategoryDbService();
     Presenter        = presenter;
     Form             = form;
 }
        public virtual async Task <IHttpActionResult> VariantSelection(GetProductRequest request)
        {
            if (request == null)
            {
                return(BadRequest("No request found."));
            }

            var vm = await ProductViewService.GetProductViewModelAsync(new GetProductParam
            {
                ProductId   = request.ProductId,
                VariantId   = request.VariantId,
                CultureInfo = ComposerContext.CultureInfo,
                Scope       = ComposerContext.Scope,
                BaseUrl     = RequestUtils.GetBaseUrl(Request).ToString()
            }
                                                                       );

            //Some additionnal Context Required by JS - used by Product Quick View on search page
            vm.Context["Images"]           = vm.Images;
            vm.Context["SelectedImage"]    = vm.SelectedImage;
            vm.Context["FallbackImageUrl"] = vm.FallbackImageUrl;
            vm.Context["allVariants"]      = vm.Variants;
            return(Ok(vm));
        }
        //private readonly IHostingEnvironment hostingEnvironment;
        //private readonly ILogger<HomeController> logger;

        public HomeController(IUnitOfWork unitOfWork)
        {
            _unitOfWork         = unitOfWork;
            _productViewService = new ProductViewService(_unitOfWork);
        }