ajax+asp无限级分类树型结构的代码

2019-09-14 07:20:28于丽

                    end if
                end if
                set rsPrevOrderID=nothing
            end if
            nOrderID=prevOrderID+1
        else
            nOrderID=0
            sParentPath="0"
            nDepth=0
        end if
        set rs=nothing
        nChild=0
        sql="insert into ArticleClass (ClassID,ClassName,ParentID,ParentPath,Depth,RootID,Child,OrderID,FilePath) values ("& nClassID &",'"& sClassName &"',"& nParentID &",'"& sParentPath &"',"& nDepth &","& nRootID &","& nChild &","& nOrderID &",'"& sFilePath &"')"
        conn.execute(sql)
        if ParentID>0 then
        '更新其父类的子栏目数
            conn.execute("update ArticleClass set child=child+1 where ClassID="& nParentID)

        '更新该栏目排序以及大于本需要和同在本分类下的栏目排序序号
            if prevOrderID<>"" then
                conn.execute("update ArticleClass set OrderID=OrderID+1 where rootid=" & nRootid & " and OrderID>"& prevOrderID &" and ClassID<>"& nClassID)
            end if
        end if
    End Sub
    Public Function FEditCheck()    '类别修改检查函数,结果为0表示通过检查,为1表示有错误发生,有错误发生时退出函数,将错误信息写入错误变量ErrorStr
        dim temprs
        FEditCheck=0