Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public static DataSet GetPagerData(int intPageSize, int intCurrentPageIndex)
        {
            int num  = 0;
            int num2 = 0;

            return(GoodsClass.GetPagerData(intPageSize, intCurrentPageIndex, ref num, ref num2));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 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));
 }
Ejemplo n.º 7
0
 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));
 }
Ejemplo n.º 8
0
 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));
 }
Ejemplo n.º 9
0
        public static IList <GoodsClassInfo> GetList(int intTopCount, string strCondition)
        {
            string strSort = " Sort asc,AutoID desc ";

            return(GoodsClass.GetList(intTopCount, strCondition, strSort));
        }
Ejemplo n.º 10
0
 public static IList <GoodsClassInfo> GetTopNList(int intTopCount, string strSort)
 {
     return(GoodsClass.GetList(intTopCount, string.Empty, strSort));
 }
Ejemplo n.º 11
0
 public static IList <GoodsClassInfo> GetAllList()
 {
     return(GoodsClass.GetList(0, string.Empty));
 }
Ejemplo n.º 12
0
 public static GoodsClassInfo GetTopData()
 {
     return(GoodsClass.GetTopData(" Sort ASC,AutoID desc "));
 }