简单账表-单据联查功能(双击单元格)
表单插件开发,实现简单账表中单据编号联查查看单据功能,代码实现如下
```
//单元格,双击事件
public override void CellDbClick(CellEventArgs Args)
{
base.CellDbClick(Args);
BillShowParameter billShowParameter = new BillShowParameter();
ReportHeader header = Args.Header;
string text = header.FieldName.ToString().Trim();
//获取行FID GetCurrentRowValue
string billno = ((ISysReportViewService)this.View).GetCurrentRowValue(text).ToString();
switch (text)
{
case "cgbillno":
SetBillOpenParam(billno, "PUR_PurchaseOrder", ref billShowParameter);
break;
case "xsbillno":
SetBillOpenParam(billno, "SAL_SaleOrder", ref billShowParameter);
break;
case "rkbillno":
SetBillOpenParam(billno, "STK_InStock", ref billShowParameter);
break;
}
if (billShowParameter.PKey != null && billShowParameter.PKey.Trim() != "" && billShowParameter.PKey.Trim() != "0")
{
View.ShowForm(billShowParameter);
billno = string.Empty;
billShowParameter = new BillShowParameter();
}
}
private void SetBillOpenParam(string billNo, string formId, ref BillShowParameter billShowPara)
{
PermissionAuthResult permissionAuthResult = PermissionServiceHelper.FuncPermissionAuth(base.Context, new BusinessObject
{
Id = formId
}, "6e44119a58cb4a8e86f6c385e14a17ad");
PermissionAuthResult permissionAuthResult2 = PermissionServiceHelper.FuncPermissionAuth(base.Context, new BusinessObject
{
Id = formId
}, "f323992d896745fbaab4a2717c79ce2e");
if (!permissionAuthResult2.Passed)
{
if (!permissionAuthResult.Passed)
{
View.ShowMessage(ResManager.LoadKDString("你没有当前单据查看权限,请设置!", "004099000015123", SubSystemType.SCM), MessageBoxType.Notice);
return;
}
}
else
{
billShowPara.Status = OperationStatus.EDIT;
}
long num = 0L;
string defaultBillTypeId = "";
string empty = string.Empty;
if (billNo.Trim().Length > 0)
{
IQueryService service = ServiceFactory.GetService<IQueryService>(base.Context);
QueryBuilderParemeter queryBuilderParemeter = new QueryBuilderParemeter();
queryBuilderParemeter.FormId = formId;
queryBuilderParemeter.SelectItems = SelectorItemInfo.CreateItems("FBILLNO,FID,FBILLTYPEID");
queryBuilderParemeter.FilterClauseWihtKey = $" FBILLNO = '{billNo}' ";
QueryBuilderParemeter para = queryBuilderParemeter;
DynamicObjectCollection dynamicObjectCollection = service.GetDynamicObjectCollection(base.Context, para, null);
if (dynamicObjectCollection.Count > 0)
{
num = Convert.ToInt64(((Collection<DynamicObject>)dynamicObjectCollection)[0]["FID"].ToString());
defaultBillTypeId = Convert.ToString(((Collection<DynamicObject>)dynamicObjectCollection)[0]["FBILLTYPEID"]);
}
}
billShowPara.FormId = formId;
billShowPara.PKey = num.ToString();
billShowPara.DefaultBillTypeId = defaultBillTypeId;
}
没有注释。。。看不懂啊 大神
简单账表-单据联查功能(双击单元格)
表单插件开发,实现简单账表中单据编号联查查看单据功能,代码实现如下``` //单元格,双击事件 public over...
点击下载文档
本文2024-09-16 17:17:02发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14708.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章