public override void BeginOperationTransaction(BeginOperationTransactionArgs e) { base.BeginOperationTransaction(e); if (e.DataEntitys != null && e.DataEntitys.Length > 0) { for (int i = 0; i < e.DataEntitys.Length; i++) { DynamicObject dataEntity = e.DataEntitys[i]; string DocumentStatus = dataEntity["DocumentStatus"].GetString(); if (DocumentStatus != "C")//非已审核 { DynamicObjectCollection F_VTR_AuditUser = dataEntity["F_VTR_AuditUser"] as DynamicObjectCollection; if (F_VTR_AuditUser.Count == 0)//仓库审核人为空 { DynamicObjectCollection BillEntry = dataEntity["BillEntry"] as DynamicObjectCollection; if (BillEntry.Count > 0) { DynamicObject StockId = BillEntry[0]["StockId"] as DynamicObject; if (StockId != null) { MulBaseDataField field = this.BusinessInfo.GetField("F_VTR_AuditUser") as MulBaseDataField; DynamicObjectCollection wsAuditUser = StockId["F_VTR_AuditUser"] as DynamicObjectCollection;//仓库的仓库审核人 foreach (var item in wsAuditUser) { DynamicObject obj = new DynamicObject(F_VTR_AuditUser.DynamicCollectionItemPropertyType); obj["PKId"] = new SequenceReader(this.Context).GetSequence<long>(field.TableName, 1).First(); obj["F_VTR_AuditUser_id"] = item["F_VTR_AuditUser_id"]; obj["F_VTR_AuditUser"] = item["F_VTR_AuditUser"]; F_VTR_AuditUser.Add(obj); } } } } } } } }