public ActionResult Index(int attributeId = 0)
        {
            ProductSpecificationAttribute productSpecificationAttribute = _productOptionManager.GetSpecificationAttribute(attributeId);

            if (productSpecificationAttribute != null)
            {
                return(View(productSpecificationAttribute));
            }
            return(RedirectToAction("Index", "ProductSpecificationAttribute"));
        }
コード例 #2
0
 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));
     }
 }