Option Explicit
Private Const MODULE_NAME = "auDemo.WSC" Private Const OP_READ_DEMO =
Private Const OP_ADD_DEMO =
Private Const OP_EDIT_DEMO =
Private Const OP_DELETE_DEMO =
Private Const OP_CREATE_DEMO_REPORT = Dim oEccomOperation,dbDemo
Set oEccomOperation = CreateObject("EccomSystem.Operation")
Set dbDemo = CreateObject("dbDemo.wsc") Private Function GetContent(idDemo)
Dim rs,arrContent(,)
Set rs = dbDemo.GetDemo(idDemo)
If rs.EOF Then Err.Raise ,MODULE_NAME,"相关信息不存在。"
arrContent(,) = "ID" : arrContent(,) = idDemo
arrContent(,) = "State" : arrContent(,) = rs("State") & ""
rs.Close
GetContent = arrContent
End Function Public Function CanReadDemo(idOperator,idDemo)
Dim arrContent
arrContent = GetContent(idDemo)
CanReadDemo = oEccomOperation.CanHeRead(idOperator,OP_READ_DEMO,arrContent)
End Function Public Function CanAddDemo(idOperator,bCommit,arrNewContent)
If Not bCommit Then
CanAddDemo = oEccomOperation.CanHeBeginAdd(idOperator,OP_ADD_DEMO)
Else
CanAddDemo = oEccomOperation.CanHeCommitAdd(idOperator,OP_ADD_DEMO,arrNewContent)
End If
End Function Public Function CanEditDemo(idOperator,idDemo,bCommit,arrNewContent)
Dim rs,arrContent
CanEditDemo = False '内置,状态为(编辑中)才编辑
Set rs = dbDemo.GetDemo(idDemo)
If rs.EOF Then Err.Raise ,MODULE_NAME,"相关信息不存在。"
If Not rs("State") = "编辑中" Then Exit Function arrContent = GetContent(idDemo)
If Not bCommit Then
CanEditDemo = oEccomOperation.CanHeBeginEdit(idOperator,OP_EDIT_DEMO,arrContent)
Else
CanEditDemo = oEccomOperation.CanHeCommitEdit(idOperator,OP_EDIT_DEMO,arrContent,arrNewContent)
End If
End Function Public Function CanDeleteDemo(idOperator,idDemo)
Dim arrContent
arrContent = GetContent(idDemo)
CanDeleteDemo = oEccomOperation.CanHeDelete(idOperator,OP_DELETE_DEMO,arrContent)
End Function Public Function ListWhoCanEdit(idDemo)
Dim arrContent
arrContent = GetContent(idDemo)
ListWhoCanSubmit = oEccomOperation.WhoCanBeginEdit(OP_EDIT_DEMO,arrContent)
End Function Public Function ListWhoCanRead(idDemo)
Dim arrContent
arrContent = GetContent(idDemo)
ListWhoCanRead = oEccomOperation.WhoCanRead(OP_READ_DEMO,arrContent)
End Function Function CanCreateDemoReport(idOperator,bCommit,arrNewContent)
If Not bCommit Then
CanAddDemo = oEccomOperation.CanHeBeginAdd(idOperator,OP_CREATE_DEMO_REPORT)
Else
CanAddDemo = oEccomOperation.CanHeCommitAdd(idOperator,OP_CREATE_DEMO_REPORT,arrNewContent)
End If
End Function
05-06 06:35