Пример #1
0
        /// <summary>
        /// 获取属性分组选择列表
        /// </summary>
        /// <param name="cateId">分类id</param>
        /// <returns></returns>
        private List <SelectListItem> GetAttributeGroupSelectList(int cateId)
        {
            List <SelectListItem>     itemList           = new List <SelectListItem>();
            List <AttributeGroupInfo> attributeGroupList = AdminCategories.GetAttributeGroupListByCateId(cateId);

            itemList.Add(new SelectListItem()
            {
                Text = "请选择分类", Value = "0"
            });
            foreach (AttributeGroupInfo attributeGroupInfo in attributeGroupList)
            {
                itemList.Add(new SelectListItem()
                {
                    Text = attributeGroupInfo.Name, Value = attributeGroupInfo.AttrGroupId.ToString()
                });
            }
            return(itemList);
        }
Пример #2
0
        /// <summary>
        /// 属性分组列表
        /// </summary>
        public ActionResult AttributeGroupList(int cateId = -1)
        {
            CategoryInfo categoryInfo = AdminCategories.GetCategoryById(cateId);

            if (categoryInfo == null)
            {
                return(PromptView("分类不存在"));
            }

            AttributeGroupListModel model = new AttributeGroupListModel()
            {
                AttributeGroupList = AdminCategories.GetAttributeGroupListByCateId(cateId),
                CateId             = cateId,
                CategoryName       = categoryInfo.Name
            };

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?cateId={1}", Url.Action("attributegrouplist"), cateId));
            return(View(model));
        }