在单据体中,点击文本字段的链接,打开其他单据示例代码:
///**************************************************
/// <summary>
/// 单据体表格中链接按钮点击事件
/// </summary>
/// <param name="e"></param>
/// <remarks>
/// 案例背景:
/// 单据体字段,有一个销售订单编号字段;
/// 字段锁定,列表样式为链接,单据应用列表样式
/// 需要在点击此字段时,打开销售订单
/// </remarks>
public override void EntryButtonCellClick(EntryButtonCellClickEventArgs e)
{
base.EntryButtonCellClick(e);
//单据体标识
if (e.EntryKey.EqualsIgnoreCase("F_JD_Entry"))
{
//字段标识
if (e.FieldKey.EqualsIgnoreCase("F_JD_EntryText"))
{
// 取文本字段中存储的销售订单单据编号
string billNo = this.Model.GetValue("F_JD_EntryText", e.Row) as string;
// 根据单据编号,到数据库中读取到销售订单单据内码
//using Kingdee.BOS.Core.SqlBuilder;
QueryBuilderParemeter queryParam = new QueryBuilderParemeter();
queryParam.FormId = "SAL_SaleOrder";
// using Kingdee.BOS.Core.Metadata;
queryParam.SelectItems.Add(new SelectorItemInfo("FID"));
queryParam.FilterClauseWihtKey = string.Format(" FBillNo = '{0}' ", billNo);
// using Kingdee.BOS.ServiceHelper;
var objs = QueryServiceHelper.GetDynamicObjectCollection(this.Context, queryParam);
if (objs != null && objs.Count > 0)
{
long billId = Convert.ToInt64(objs[0][0]);
// 显示销售订单维护界面
BillShowParameter showParam = new BillShowParameter();
showParam.FormId = "SAL_SaleOrder";
showParam.Status = OperationStatus.EDIT;
showParam.PKey = billId.ToString();
this.View.ShowForm(showParam);
}
}
}
}
本文转载自:金蝶社区
作者:JohnnyDing
原文链接:https://club.kingdee.com/forum.php?mod=viewthread&tid=981072&page=1#pid2601273