示例#1
0
        public ActionResult Index(int id)
        {
            ViewBag.categoryname = Category.GetByID(id).cat_name;
            ViewBag.cateID       = Category.GetByID(id).TD;

            var SubcategoryModel = new SubcategoryModelView()
            {
                subCategories = _db.Get().Where(x => x.CategoryId == id).ToList()
            };

            return(View(SubcategoryModel));
        }
示例#2
0
        public IViewComponentResult Invoke(int id)
        {
            if (id == 0)
            {
                var prodDetailsVm = new ProductDetailsViewModel()
                {
                    Product        = prodRepo.Get(id),
                    AttributeGroup = attrGroupRepo.Get(id),
                    OneAttribute   = OneAttributeRepo.Get(id)
                };

                return(View(prodDetailsVm));
            }
            else
            {
                var prod      = prodRepo.Get(id);
                var prodSub   = subCatRepo.Get(prod.Id);
                var attrGroup = attrGroupRepo.Get(prodSub.Id);

                return(View());
            }
        }
示例#3
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));
        }
示例#4
0
 public IActionResult Get(int id)
 {
     return(View(subCatrepo.Get(id)));
 }