public ActionResult ProductDetail(Guid ProductID) { ProductViewModel productViewModel = new ProductViewModel(); ProductDTO productDTO = new ProductDTO(); try { productDTO = productBusinessContext.GetProduct(ProductID); productViewModel = ProductProductVMMapper.Map <ProductDTO, ProductViewModel>(productDTO); productViewModel.variantDisplay = ProductProductVMMapper.Map <VariantDTO, VariantViewModel>(productDTO.Variants.FirstOrDefault()); return(View(productViewModel)); } catch (CatgoryDoesNotExistsException ex) { return(View("Error")); } catch (Exception ex) { return(View("InternalError")); } }
public ActionResult ProductDetail(Guid ProductID) { ProductViewModel productViewModel = new ProductViewModel(); ProductDTO productDTO = new ProductDTO(); try { productDTO = productBusinessContext.GetProduct(ProductID); productViewModel = ProductViewModelMapper.Map <ProductDTO, ProductViewModel>(productDTO); productViewModel.variantDisplay = ProductViewModelMapper.Map <VariantDTO, VariantViewModel>(productDTO.Variants.FirstOrDefault()); return(RedirectToAction("ShowVariant", new { variantID = productViewModel.variantDisplay.ID })); //productViewModel.IsLoggedIn = true; //return View(productViewModel); } catch (ProductDoesNotExistsException) { return(View("Error")); } catch (Exception ex) { return(View("Internal Error" + ex)); } }
public ActionResult ProductDetail(Guid ProductID) { ProductViewModel viewModel = new ProductViewModel(); ProductDTO productDTO = new ProductDTO(); try { productDTO = productBusinessContext.GetProduct(ProductID); } catch (CategoryDoesNotExistsException ex) { return(View("Error")); } catch (Exception ex) { return(View("Internal Error")); } viewModel = _ProductProductVMMapper.Map <ProductDTO, ProductViewModel>(productDTO); viewModel.IsLoggedIn = true; return(View(viewModel)); }