金蝶晕云星空表单插件:操作子单据体的删除触发父单据体的字段重算

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);//数量 FOldQty
        this.View.InvokeFieldUpdateService("FQty", entryCurrentRowIndex);//触发数量的值更新事件
        this.View.UpdateView(entityKey);
    }
}

 

posted @ 2024-08-12 19:09  lanrenka  阅读(34)  评论(0编辑  收藏  举报