我在自定义单据上写了插件,代码如下
public override void OnShowConvertOpForm(Kingdee.BOS.Core.List.PlugIn.Args.ShowConvertOpFormEventArgs e)
{
base.OnShowConvertOpForm(e);
if (e.ConvertOperation == FormOperationEnum.Push && !string.IsNullOrWhiteSpace("FEntity"))
{
IList
EntryEntity entryEntity = this.View.BusinessInfo.GetEntryEntity("FEntity");
if (entryEntity != null)
{
int[] selRows = this.View.GetControl
DynamicObjectCollection rowDatas = this.Model.GetEntityDataObject(entryEntity);
if (selRows.Count() > 0 && !selRows.Any(x => x < 0))
{
if (rowDatas != null && rowDatas.Count() > 0)
{
foreach (var rowIndex in selRows)
{
DynamicObject rowData = rowDatas[rowIndex];
ListSelectedRow row = new ListSelectedRow(this.Model.DataObject["Id"].ToString(), Convert.ToString(rowData["Id"]), rowIndex, this.View.BusinessInfo.GetForm().Id) { EntryEntityKey = "FEntity" };
seltedRow.Add(row);
}
}
}
else
{
foreach (var rowData in rowDatas)
{
ListSelectedRow row = new ListSelectedRow(this.Model.DataObject["Id"].ToString(), Convert.ToString(rowData["Id"]), this.View.Model.GetRowIndex(entryEntity, rowData), this.View.BusinessInfo.GetForm().Id) { EntryEntityKey = "FEntity" };
seltedRow.Add(row);
}
}
e.SelectedRows = seltedRow.ToArray();
}
}
}
就不能实现默认全部分录下推了,怎么处理啊,急急
推荐阅读