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)); }
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()); } }
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 Get(int id) { return(View(subCatrepo.Get(id))); }