//------------------------------------------------------------多层判断开始 string lblClassNames="";//当前类名称 string str=""; if(this.Request.QueryString["classID"]!="" && this.Request.QueryString["classID"]!=null) { parents=Convert.ToInt32(this.Request.QueryString["ClassID"]); this.classNameID=parents.ToString(); } else { this.classNameID="0"; parents=0; } int parent=parents; if(this.Request.QueryString["layer"]!="" && this.Request.QueryString["layer"]!=null) { int classID; string className=""; string sql=""; bool isGetClassName=true; Inc inc=new Inc(); layers=Convert.ToInt32(this.Request.QueryString["layer"]); for(int ii=layers;ii>0;ii--) { sql="select className from proClass where id="+parents.ToString(); className=inc.getItem(sql); classTop=""+className+""+classTop; sql="select id from proClass where id="+parents.ToString(); classID=Convert.ToInt32(inc.getItem(sql)); sql="select parent from proClass where id="+parents.ToString(); parents=Convert.ToInt32(inc.getItem(sql)); str="》"+className+""+str; if(isGetClassName) { lblClassNames=className; } } parents=parent; } else { layers=0; } classTop=str; //输出顶端链接 //------------------------------------------多层判断结束
无限子类,无限菜单的算法
最新推荐文章于 2022-09-06 09:27:23 发布