开发过程中经常有这样的需求:
自定义菜单开发了比较复杂的界面,界面中需要打开另一个自己开发的功能,或者菜单,或者单据,代码如何实现呢?
今天我们就来说到说到。
首先添加引用:using UFIDA.U8.Portal.Framework.Commands;using UFIDA.U8.Portal.Proxy.Accessory;
然后在代码中添加如下方法
using UFIDA.U8.Portal.Framework.Commands;
using UFIDA.U8.Portal.Proxy.Accessory;
public static void ExcuteJoinQueryU8Voucher( string menuID, string menuName, string subID, string authID, string cardNumber, string pkFieldValue)
{
string cmdLine = "";
cmdLine = "ID:{0}&&&Name:{1}&&&SubSysID:{2}&&&AuthID:{3}&&&CMDLINE:{4}\t{5}";
cmdLine = string.Format(cmdLine, menuID, menuName, subID, authID, cardNumber, pkFieldValue);
IPortalCommandOperator portalCommandOperator = new PortalCommandOperator();
IPortalCommandArgs portalCommandArgs = new PortalCommandArgs(menuID, subID);
portalCommandArgs.AuthId = authID;
portalCommandArgs.DocId = string.Empty;
portalCommandArgs.DocType = string.Empty;
portalCommandArgs.ID = menuID;
portalCommandArgs.Name = menuName;
portalCommandArgs.SubFunction = string.Empty;
portalCommandArgs.Extenision = string.Empty;
portalCommandArgs.SubSysID = subID;
portalCommandArgs.CmdLine = cmdLine;
portalCommandArgs.FromUserClick = false;
portalCommandArgs.ExtProperties.Add("recheck", "1");
portalCommandOperator.RunBusiness(portalCommandArgs);
}
上文代码中重点是需要拼接cmdline字符串
cmdLine = "ID:{0}&&&Name:{1}&&&SubSysID:{2}&&&AuthID:{3}&&&CMDLINE:{4}\t{5}";
接下来,在使用的地方,复制下面的代码可以打开收款单
ExcuteJoinQueryU8Voucher("AR1020201", "联查收款单", "AR", "AR22101", "AR49", iid);
参数说明:第一个参数是菜单ID,检查ua_menu表第二个参数是菜单名称,检查ua_menu表第三个参数是模块第四个参数是菜单对应的权限ID第五个参数是单据number第六个参数是单据的主表id 标签:U8,跳转,cmdLine,portalCommandArgs,&&&,联查,ID,string From: https://www.cnblogs.com/u8dev/p/u8-voucher-link-open.html