<Public>
<property name="Types">
<get/>
</property>
<method name="GetTypeName">
<parameter name="iVal"/>
</method>
</Public>
<implements type="ASP" id="ASP"/>
<script language="VBScript">
<![CDATA[
Option Explicit
Private Const MODULE_NAME = "bzDemo.wsc"
Private Const DOC_DEF_ID = 350
Private Const LOG_CLASS_ID = 350
Dim auDemo,dbDemo,auCommon
Set auDemo = CreateObject("auDemo.wsc")
Set dbDemo = CreateObject("dbDemo.wsc")
Set auCommon = CreateObject("auCommon.wsc")
Dim arrType(1,2)
arrType(0,0) = 1 : arrType(1,0) = "类型1"
arrType(0,1) = 2 : arrType(1,1) = "类型2"
arrType(0,2) = 3 : arrType(1,2) = "类型3"
Public Function Get_Types()
Get_Types = arrType
End Function
Public Function GetTypeName(iVal)
Dim i
GetTypeName = "?"
For i = 0 To UBound(arrType,2)
If arrType(0,i) = iVal Then
GetTypeName = arrType(1,i)
Exit For
End If
Next
End Function
Private Function fnAddLog(idDemo,dtEventTime,sEventType,idEventHandler,sEventDescription)
Dim dbLog
Set dbLog = CreateObject("dbLog.wsc")
Call dbLog.AddLog(LOG_CLASS_ID,idDemo,dtEventTime,sEventType,idEventHandler,sEventDescription,Null,Null,Null,Null,Null)
End Function
Function ListLog(idDemo,dtLogFrom,dtLogTo)
Dim dbLog
Set dbLog = CreateObject("dbLog.wsc")
Set ListLog = dbLog.ListLog3(Array(LOG_CLASS_ID),dtLogFrom,dtLogTo,idDemo,Null,Null,Null,Null,"LogTimeDESC")
End Function
Public Function AddDemo(sName,iAge)
Dim arrNewContent(1,1),idDemo
arrNewContent(0,0) = "Name" : arrNewContent(1,0) = sName
arrNewContent(0,1) = "Age" : arrNewContent(1,1) = iAge
If Not auDemo.CanAddNews(auCommon.Logon_UID,True,arrNewContent) Then Err.Raise 1,MODULE_NAME,"你没有新建的权限。"
idDemo = dbDemo.Add(sName,iAge)
Dim sLog
sLog = ""
Call fnAddLog(idDemo,Now,"新增",auCommon.Logon_UID,sLog)
AddDemo = idDemo
End Function
]]>
</script>