加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ajax+asp无限级分类树型框架 带数据库

发布时间:2023-07-10 13:29:20 所属栏目:Asp教程 来源:
导读:IE测试通过,FF有点小BUGCls_Leibie.asp代码如下:<%&#39;数据库字段为类属性,添加、删除、修改、操作检查等函数为类的方法Class Cls_LeibiePrivate nClassID,sClassName,nParentID,sParentPath,nDepth,nRootID,nChi

IE测试通过,FF有点小BUG

Cls_Leibie.asp

代码如下:

<%

'数据库字段为类属性,添加、删除、修改、操作检查等函数为类的方法

Class Cls_Leibie

Private nClassID,sClassName,nParentID,sParentPath,nDepth,nRootID,nChild,nOrderID,sFilePath '定义私有变量(类的属性,即数据库字段对应的变量)

Private rs,sql,ErrorStr

Private Sub Class_Initialize()

ErrorStr="" '初始化错误信息为空

End Sub

Private Sub Class_Terminate() '销毁类时关闭数据库连接

If IsObject(Conn) Then

Conn.Close

Set Conn = Nothing

End If

End Sub

'*******************设置各个属性******************************************************

Public Property Let ClassID(str) '获取类别ID(主键)

nClassID=str

call ClassProperty() '获取类别ID时调用此函数读出类的所有属性

End Property

Public Property Let ClassName(str) '获取类别名称

sClassName=str

End Property

Public Property Get ClassName

ClassName=sClassName

End Property

Public Property Let ParentID(str) '获取类别父ID

nParentID=str

End Property

Public Property Get ParentID

ParentID=nParentID

End Property

Public Property Let ParentPath(str) '获取父路径ID

sParentPath=str

End Property

Public Property Get ParentPath

ParentPath=sParentPath

End Property

Public Property Let Depth(str) '获取类别深度

nDepth=str

End Property

Public Property Get Depth

Depth=nDepth

End Property

Public Property Let RootID(str) '获取类别根ID

nRootID=str

End Property

Public Property Get RootID

RootID=nRootID

End Property

Public Property Let Child(str) '子类别个数

nChild=str

End Property

Public Property Get Child

Child=nChild

End Property

Public Property Let OrderID(str) '排序ID

nOrderID=str

End Property

Public Property Get OrderID

OrderID=nOrderID

End Property

Public Property Let FilePath(str) '类别文件根目录(生成静态文件路径,小站老杨Web技术博客用的是生成静态,故设置此字段)

sFilePath=str

End Property

Public Property Get FilePath

FilePath=sFilePath

End Property

'******************************************************************************

Private Sub ClassProperty() '读取类的所有属性

sql="select * from ArticleClass where ClassID="& nClassID

set rs=conn.execute(sql)

if not rs.eof then

sClassName=trim(rs("ClassName"))

nParentID=trim(rs("ParentID"))

sParentPath=trim(rs("ParentPath"))

nDepth=trim(rs("Depth"))

nRootID=trim(rs("RootID"))

nChild=trim(rs("Child"))

nOrderID=trim(rs("OrderID"))

sFilePath=trim(rs("FilePath"))

end if

set rs=nothing

End Sub

Public Function FAddCheck() '类别添加检查函数,结果为0表示通过检查,为1表示有错误发生,有错误发生时退出函数,将错误信息写入错误变量ErrorStr。

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章