/// <summary> /// 获取TreeInfo /// </summary> /// <param name="selectedSysNo">选中的节点SysNo</param> /// <param name="sellerSysNo">商家编号</param> /// <returns></returns> public static List <TreeInfo> GetTreeInfo(int selectedSysNo, int sellerSysNo) { List <TreeInfo> treeList = new List <TreeInfo>(); List <FrontProductCategoryInfo> list = ProductDA.GetFrontProductCategory(sellerSysNo); if (list != null && list.Count > 0) { List <FrontProductCategoryInfo> firstList = list.FindAll(item => string.IsNullOrEmpty(item.ParentCategoryCode)); if (firstList != null && firstList.Count > 0) { foreach (var item in firstList) { TreeInfo treeInfo = MappingTreeInfo(item, selectedSysNo, list); treeList.Add(treeInfo); SetChildTreeInfo(list, treeInfo, item.CategoryCode, selectedSysNo); } } } return(treeList); }
/// <summary> /// 获取当前商家下的所有分类信息 /// </summary> /// <param name="vendorSysNo"></param> /// <returns></returns> public static List <FrontProductCategoryInfo> GetFrontProductCategoryByVendorSysNo(int vendorSysNo) { return(ProductDA.GetFrontProductCategory(vendorSysNo)); }