简单账表(表单插件)单据编号联查单据

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

简单账表(表单插件)单据编号联查单据

话不多说,直接干货走起。。。。。 public class TestBillPlugin: AbstractSysReportPlugIn { //单元格,双击事件 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 class TestBillPlugin: AbstractSysReportPlugIn { //单元格,...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息