public static List <GoodsClassInfo> GetRelationList(List <GoodsClassInfo> list, int intParentID) { List <GoodsClassInfo> list2 = list.FindAll((GoodsClassInfo parameterA) => parameterA.ParentID == intParentID); List <GoodsClassInfo> list3 = new List <GoodsClassInfo>(); int num = 0; foreach (GoodsClassInfo current in list2) { if (num == list2.Count - 1) { current.ClassName = ((current.ParentID == 0) ? "" : StringUtils.GetCatePrefix(current.Depth - 1, true)) + current.ClassName; } else { current.ClassName = ((current.ParentID == 0) ? "" : StringUtils.GetCatePrefix(current.Depth - 1, false)) + current.ClassName; } list3.Add(current); if (current.ChildCount > 0) { list3.AddRange(GoodsClass.GetRelationList(list, current.AutoID)); } num++; } return(list3); }
public static DataSet GetPagerData(int intPageSize, int intCurrentPageIndex) { int num = 0; int num2 = 0; return(GoodsClass.GetPagerData(intPageSize, intCurrentPageIndex, ref num, ref num2)); }
public static List <GoodsClassInfo> GetCateTreeList() { List <GoodsClassInfo> obj = (List <GoodsClassInfo>)GoodsClass.GetAllList(); List <GoodsClassInfo> list = JObject.DeepClone <List <GoodsClassInfo> >(obj); return(GoodsClass.GetRelationList(list, 0)); }
public static int AddExt(GoodsClassInfo entity) { int num = GoodsClass.Add(entity); if (num > 0) { if (entity.ParentID.Equals(0)) { entity.RootID = num; entity.Depth = 1; entity.ChildCount = 0; } else { GoodsClassInfo dataById = GoodsClass.GetDataById(entity.ParentID); if (dataById != null) { entity.RootID = dataById.RootID; entity.Depth = dataById.Depth + 1; entity.ChildCount = 0; dataById.ChildCount++; GoodsClass.Update(dataById); } } entity.AutoID = num; GoodsClass.Update(entity); } return(num); }
public static bool DeleteExt(int intPrimaryKeyIDValue) { GoodsClassInfo dataById = GoodsClass.GetDataById(intPrimaryKeyIDValue); bool result; if (dataById != null) { if (GoodsClass.Delete(intPrimaryKeyIDValue)) { BizBase.dbo.UpdateTable("update shop_GoodsClass set ChildCount=ChildCount-1 where ChildCount>0 AND AutoID=" + dataById.ParentID); } result = true; } else { result = false; } return(result); }
public static IList <GoodsClassInfo> GetPagerList(int intCurrentPageIndex, int intPageSize, ref int intTotalCount, ref int intTotalPage) { return(GoodsClass.GetPagerList("", "Sort ASC,AutoID DESC", intCurrentPageIndex, intPageSize, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strFilter, string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(GoodsClass.GetPagerData(strFilter, strCondition, " Sort asc,AutoID desc ", intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static DataSet GetPagerData(string strCondition, int intPageSize, int intCurrentPageIndex, ref int intTotalCount, ref int intTotalPage) { return(GoodsClass.GetPagerData("*", strCondition, intPageSize, intCurrentPageIndex, ref intTotalCount, ref intTotalPage)); }
public static IList <GoodsClassInfo> GetList(int intTopCount, string strCondition) { string strSort = " Sort asc,AutoID desc "; return(GoodsClass.GetList(intTopCount, strCondition, strSort)); }
public static IList <GoodsClassInfo> GetTopNList(int intTopCount, string strSort) { return(GoodsClass.GetList(intTopCount, string.Empty, strSort)); }
public static IList <GoodsClassInfo> GetAllList() { return(GoodsClass.GetList(0, string.Empty)); }
public static GoodsClassInfo GetTopData() { return(GoodsClass.GetTopData(" Sort ASC,AutoID desc ")); }