예제 #1
0
        private bool isisis(long cid)
        {
           DataTable dt= new Spread.BLL.Catalog().GetList(1, string.Format("CatalogId='{0}'", cid), "Id").Tables[0];

           if (dt != null && dt.Rows.Count > 0)
           {
               return true;
           }
           else { return false; }
        }
예제 #2
0
        private int addcata(long cid, string title, int parentid)
        {
            int calssid = 0;
            int classLayer = 1;                                         //栏目深度
            string classList = "";



            int sort = new Spread.BLL.Catalog().GetMaxSortID(parentid);

            Spread.BLL.Catalog bll = new Spread.BLL.Catalog();

            Spread.Model.Catalog model = new Spread.Model.Catalog();
            model.CatalogID = cid;
            model.Title = title;
            model.ParentId = parentid;
            model.ClassList = "";
            model.ClassOrder = sort;
            model.IsShow = true;
            model.IsLock = false;
            model.IsMenu = false;


            //添加栏目
            calssid = bll.Add(model);
            //修改栏目的下属栏目ID列表
            if (parentid > 0)
            {
                DataSet ds = bll.GetCatalogListByClassId(parentid);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    classList = dr["ClassList"].ToString().Trim() + calssid + ",";
                    classLayer = Convert.ToInt32(dr["ClassLayer"]) + 1;
                }
            }
            else
            {
                classList = "," + calssid + ",";
                classLayer = 1;
            }
            model.Id = calssid;
            model.ClassList = classList;
            model.ClassLayer = classLayer;
            new Spread.BLL.Catalog().Update(model);

            return calssid;
        }
예제 #3
0
 /// <summary>
 /// 获取游戏类目
 /// </summary>
 private void GetProductCatalog(int id)
 {
     DataTable dt = new Spread.BLL.Catalog().GetList(1, " ClassList ", string.Format(" id={0} ", id), " ClassOrder ").Tables[0];
     if (dt != null && dt.Rows.Count > 0)
     {
         string catapath = dt.Rows[0][0].ToString().TrimStart(',').TrimEnd(',');
         if (catapath.Length > 0)
         {
             this.CatalogPath = new Spread.BLL.Catalog().GetList(0, "Id,ParentID ,Title ",string.Format(" id in ({0})",catapath), "Id").Tables[0];
         }
     }
 }