金蝶云星空表单插件:操作子单据体的删除触发父单据体的字段重算
public override void AfterDeleteRow(AfterDeleteRowEventArgs e)
{
base.AfterDeleteRow(e);
if (e.EntityKey.Equals(asEntityKey))
{
Entity entity = this.View.BillBusinessInfo.GetEntity(entityKey);
int entryCurrentRowIndex = this.Model.GetEntryCurrentRowIndex(entityKey);
DynamicObject EntityRow = this.View.Model.GetEntityDataObject(entity, entryCurrentRowIndex);
DynamicObjectCollection afterEntry = EntityRow[asEntityKey] as DynamicObjectCollection;
int qty = afterEntry.Count();
this.View.Model.SetValue("FQty", qty, entryCurrentRowIndex);
this.View.InvokeFieldUpdateService("FQty", entryCurrentRowIndex);
this.View.UpdateView(entityKey);
}
}