Option Explicit Private Const MODULE_NAME = "auDemo.WSC" Private Const OP_ADD_DEMO = "1" Private Const OP_EDIT_DEMO = "2" Private Const OP_READ_DEMO = "3" Private Const OP_DELETE_DEMO = "4" Private Const OP_SUBMIT_DEMO = "5" Dim oEccomOperation,dbDemo Set oEccomOperation = CreateObject("EccomSystem.Operation") Set dbDemo = CreateObject("dbDemo.wsc") Private Function GetContent(idDemo) Dim rs,arrContent(1,1) Set rs = dbDemo.GetDemo(idDemo) If rs.EOF Then Err.Raise 1,MODULE_NAME,"相关信息不存在。" arrContent(0,0) = "ID" : arrContent(1,0) = idDemo arrContent(0,1) = "State" : arrContent(1,1) = 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 1,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 CanSubmitDemo(idOperator,idDemo) Dim rs,arrContent CanSubmitDemo = False ‘内置,状态为(编辑中)才提交 Set rs = dbDemo.GetDemo(idDemo) If rs.EOF Then Err.Raise 1,MODULE_NAME,"相关信息不存在。" If Not rs("State") = "编辑中" Then Exit Function arrContent = GetContent(idDemo) CanSubmitDemo = oEccomOperation.CanHeBeginEdit(idOperator,OP_SUBMIT_DEMO,arrContent) End Function Public Function CanDeleteDemo(idOperator,idDemo) Dim arrContent arrContent = GetContent(idDemo) CanDeleteDemo = oEccomOperation.CanHeDelete(idOperator,OP_DELETE_DEMO,arrContent) End Function Public Function ListWhoCanSubmit(idDemo) Dim arrContent arrContent = GetContent(idDemo) ListWhoCanSubmit = oEccomOperation.WhoCanBeginEdit(OP_SUBMIT_DEMO,arrContent) End Function Public Function ListWhoCanRead(idDemo) Dim arrContent arrContent = GetContent(idDemo) ListWhoCanRead = oEccomOperation.WhoCanRead(OP_READ_DEMO,arrContent) End Function Function WhoCanReceiveNotifyEmail() End Function
时间: 2024-10-13 02:21:42