|
发表于 2013-4-2 15:26:32
|
显示全部楼层
Option Explicit
Implements UFPortalProxyInterface.ILoginable
Private m_oBusiness As Object
Private m_oLogin As Object
Public Property Get Business() As Object
Set Business = m_oBusiness
End Property
' 初始化,获取Business对象,并初始化Login对象
Public Property Set Business(ByRef bBus As Object)
Set m_oBusiness = Nothing
Set m_oLogin = Nothing
Set m_oBusiness = bBus
End Property
Private Function ILoginable_Login() As Boolean
ILoginable_Login = True
If ((Not m_oBusiness Is Nothing) And (m_oLogin Is Nothing)) Then
Set m_oLogin = m_oBusiness.GetVBclsLogin() '获得login对象
ILoginable_Login = True
Exit Function
Else
Set m_oBusiness = Nothing
Set m_oLogin = Nothing
ILoginable_Login = False
Exit Function
End If
End Function
Private Function ILoginable_LogOff() As Boolean
ILoginable_LogOff = True
End Function
Public Function ILoginable_CallFunction(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String) As Object
Dim vfd As Object
Dim strConn As String
Dim stc As String
Dim mform As Form
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sql As String
On Error GoTo ErrTray
If Not m_oLogin Is Nothing Then
strConn = m_oLogin.UfDbName
stc = strConn
If DBconn Is Nothing Then
Set DBconn = New ADODB.Connection
DBconn.ConnectionTimeout = 600
DBconn.CommandTimeout = 1200
End If
If DBconn.State = 1 Then DBconn.Close
DBconn.Open strConn
Set mform = New clsFrmMain
'-mform.Show
MsgBox cMenuId
Set vfd = m_oBusiness.CreateFormEnv("xxxxxxxxxxxAxxxxxxxxxxxxxxxxx", mform)
Call m_oBusiness.ShowForm(mform, "DP", "xxxxxxxxxxxAxxxxxxxxxxxxxxxxx", False, True, vfd)
Exit Function
Else
Exit Function
End If
ErrTray:
MsgBox Err.Description, vbCritical, "发生错误:"
End Function |
|