Exemple #1
0
        public IActionResult Details(int id)
        {
            var product               = prodRepo.Get(id);
            var productOneAttrValue   = prodOneAttrValRepo.GetAll().Where(p => p.ProductId == id);
            var preDefAttrList        = predefAttrListRepo.GetAllLists();
            var preDefAttrListOptions = predefAttrListOptionsRepo.GetAllOptions();

            var prodDetVm = new ProductViewModel
            {
                ProductId   = id,
                Name        = product.Name,
                Description = product.Description,
                AddedDate   = product.AddedDate,
                UpdatedDate = product.UpdatedDate,
                SubCategoryAttributeGroups = subCatRepo.Get(product.SubCategoryId ?? 0).SubCategoryAttributeGroups,
                ProductOneAttributeValues  = productOneAttrValue,
                PredefinedAttrLists        = preDefAttrList,
                PredefinedAttrListOptions  = preDefAttrListOptions
            };

            return(View(prodDetVm));
        }
        public IActionResult Index()
        {
            var prodAttrOneGroup = prodOneAttrValRepo.GetAll();

            return(View(prodAttrOneGroup));
        }