|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
懂的人可以加我QQ,大加互相学习!
不用UAP,完全写DLL的插件开发,
发个思路吧:
用友的菜单完全可以后台加的,或者用UAP平台的菜单编辑器增加!
菜单对应的插件类的增加(主要写ua_idt表)
举例如下:
INSERT INTO [UFSystem].[dbo].[ua_idt]([id], [assembly], [catalogtype], [type], [class], [entrypoint],
[parameter], [reserved])
VALUES('你的为名称','你的类',0,0,null,null,null,null)
增加的菜单(SAM0302是销售管理子菜单)
INSERT INTO [dbo].[UA_Menu]([cMenu_Id], [cMenu_Name], [cMenu_Eng], [cSub_Id],
[IGrade], [cSupMenu_Id], [bEndGrade], [cAuth_Id], [iOrder], [iImgIndex], [Paramters], [Depends], [Flag])
VALUES('你的为名称','费用报销单',null,'SA',1,'SAM0302',1,NULL,0,0,NULL,NULL,NULL)
加好菜单后,点击菜单自然会调用你的类:
类的编写:
Implements UFPortalProxyInterface.ILoginable
Public Property Get Business() As Object
Set Business = g_business
End Property
Public Property Set Business(ByRef bBus As Object)
Set g_business = bBus
End Property
Public Sub ShowModeless(ByVal cMenuId As String, ByVal cMenuName As String, ByVal cAuthId As String, ByVal cCmdLine As String)
Dim vfd
RecordLogFile "1.0", "你的类名.ShowModeless"
RecordLogFile "2.0", "你的类名.ShowModeless"
Set vfd = g_business.CreateFormEnv("类文件.你的表单", 你的表单)
f_cardriver.sCommandLine = cCmdLine
g_business.ShowForm 你的表单, "SA", "你的表单_key01"
RecordLogFile "3.0", "你的类名.ShowModeless"
End Sub
这个用友提供的接口
你的表单就是你自己写的插件内容了!
至于如何获取用友的登录信息:
Public Function Connect() As Boolean
'设置登录对象
Dim g_Login As Object
On Error GoTo ErrProc
Set g_Login = g_business.GetVBclsLogin()
gcnn.ConnectionString = g_Login.UfDbName
g_Acc = g_Login.cAcc_Id: g_AccN = g_Login.cAccName: g_Year = g_Login.cIYear: g_Date = g_Login.CurDate: g_User = g_Login.cUserId: g_UserN = g_Login.cUserName: g_Sa = g_Login.cUserPassWord
gcnn.Open
Connect = True
Exit Function
ErrProc:
Connect = False
End Function
在单据加载时检查Connect=true
就可以取得登录的信息了,之后当是你想干嘛就干嘛了!
|
|