public ActionResult Index(int attributeId = 0) { ProductSpecificationAttribute productSpecificationAttribute = _productOptionManager.GetSpecificationAttribute(attributeId); if (productSpecificationAttribute != null) { return(View(productSpecificationAttribute)); } return(RedirectToAction("Index", "ProductSpecificationAttribute")); }
public JsonResult GetSpecificationAttributeOptions(int specificationAttributeId = 0) { try { List <SelectListItem> options = _productOptionManager.GetSpecificationAttribute(specificationAttributeId) .Options.OrderBy(x => x.DisplayOrder) .ToList() .Select(item => new SelectListItem { Selected = false, Text = item.Name, Value = item.Id.ToString() }) .ToList(); return(Json(options)); } catch { return(Json(false)); } }