• 服务插件中给仓库审核人(多选基础资料)赋值


     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);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
    
            }
  • 相关阅读:
    eclipse注释模板__自动生成方法注释
    java HashMap--统计其中有相同value的key的个数
    java synchronized 详解
    进程间通信-共享内存
    辅导-计算机编程方面
    gnu make
    适应c++ 新特性
    tomcat服务器
    springmvc笔记
    Idea使用SVN教程
  • 原文地址:https://www.cnblogs.com/zouhuaxin/p/15346269.html
Copyright © 2020-2023  润新知