Example #1
0
        //岗位默认处理
        public T_FB_SUBJECTPOST SubjectPostChanged(T_FB_SUBJECTDEPTMENT sd, T_FB_SUBJECTPOST post, string strFlag)
        {
            if (strFlag == "ACTIVED")  //ACTIVED 用于区别启用事件点击和树的点击
            {
                if (sd.ACTIVED == 1)
                {
                    post.ACTIVED = 1;
                }
                else
                {
                    post.ACTIVED = 0;
                }

                if (sd.ISPERSON == 1)
                {
                    post.ISPERSON = 1;
                }
                else
                {
                    post.ISPERSON = 0;
                }
            }
            else if (strFlag == "MoneyAssign")
            {
                post.ACTIVED  = 1;
                post.ISPERSON = 1;
            }

            return(post);
        }
Example #2
0
        public OrderEntity IsPersonChanged(OrderEntity oe, T_FB_SUBJECTDEPTMENT subjectDepartment)
        {
            if (subjectDepartment.ISPERSON == 1)
            {
                oe.FBEntity.CollectionEntity.ForEach(p =>
                {
                    p.FBEntities.ForEach(f =>
                    {
                        T_FB_SUBJECTPOST post = f.Entity as T_FB_SUBJECTPOST;
                        if (post != null && subjectDepartment.T_FB_SUBJECT.SUBJECTID == post.T_FB_SUBJECT.SUBJECTID)
                        {
                            post.ISPERSON = 1;
                        }
                    });
                });
            }
            else
            {
                oe.FBEntity.CollectionEntity.ForEach(p =>
                {
                    p.FBEntities.ForEach(f =>
                    {
                        T_FB_SUBJECTPOST post = f.Entity as T_FB_SUBJECTPOST;
                        if (post != null && subjectDepartment.T_FB_SUBJECT.SUBJECTID == post.T_FB_SUBJECT.SUBJECTID)
                        {
                            post.ISPERSON = 0;
                        }
                    });
                });
            }

            return(oe);
        }
Example #3
0
        //处理默认活动经费岗位的设置
        public void CheckMoneyAssign(ObservableCollection <FBEntity> listSave)
        {
            #region 处理默认活动经费岗位的设置
            listSave.ForEach(p =>
            {
                foreach (TreeViewItem tvi in this.currentTreeViewItem.Items)
                {
                    OrderEntity oe = tvi.DataContext as OrderEntity;
                    if (oe != null)
                    {
                        VirtualPost virtualPost = tvi.DataContext as VirtualPost;
                        //活动经费处理初始化
                        if (virtualPost != null)
                        {
                            //CreatePostEntity(virtualPost, tvi, "MoneyAssign");

                            T_FB_SUBJECTPOST subjectPost = tvi.DataContext as T_FB_SUBJECTPOST;
                            if (subjectPost != null)
                            {
                                if (subjectPost.T_FB_SUBJECT != null && subjectPost.T_FB_SUBJECT.SUBJECTID == DataCore.SystemSetting.MONEYASSIGNSUBJECTID)
                                {
                                    if (subjectPost.ACTIVED != 1 || subjectPost.ISPERSON != 1)
                                    {
                                        ComfirmWindow.ConfirmationBoxs("提示", "活动经费在此只能是启用并勾选分配个人,请确认。", Utility.GetResourceStr("CONFIRM"), MessageIcon.Question);
                                    }
                                    //sender.SetObjValue("ACTIVED", 1);
                                    //sender.SetObjValue("ISPERSON", 1);
                                }
                            }
                        }
                    }
                }
            });
            #endregion
        }
Example #4
0
        void DeatilEntity_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            //岗位科目
            T_FB_SUBJECTPOST subjectPost = sender as T_FB_SUBJECTPOST;

            if (subjectPost != null)
            {
                if (subjectPost.T_FB_SUBJECT != null && subjectPost.T_FB_SUBJECT.SUBJECTID == DataCore.SystemSetting.MONEYASSIGNSUBJECTID)
                {
                    if (subjectPost.ACTIVED != 1 || subjectPost.ISPERSON != 1)
                    {
                        ComfirmWindow.ConfirmationBoxs("提示", "活动经费在此只能是启用并勾选分配个人,并且修改无效。", Utility.GetResourceStr("CONFIRM"), MessageIcon.Question);
                    }
                    sender.SetObjValue("ACTIVED", 1);
                    sender.SetObjValue("ISPERSON", 1);
                }
            }
            //部门科目
            T_FB_SUBJECTDEPTMENT subjectDepartment = sender as T_FB_SUBJECTDEPTMENT;

            if (subjectDepartment != null)
            {
                if (subjectDepartment.T_FB_SUBJECT != null && subjectDepartment.T_FB_SUBJECT.SUBJECTID == DataCore.SystemSetting.MONEYASSIGNSUBJECTID)
                {
                    if (subjectDepartment.ACTIVED != 1 || subjectDepartment.ISPERSON != 1)
                    {
                        ComfirmWindow.ConfirmationBoxs("提示", "活动经费在此只能是启用并勾选分配个人,并且修改无效。", Utility.GetResourceStr("CONFIRM"), MessageIcon.Question);
                    }
                    sender.SetObjValue("ACTIVED", 1);
                    sender.SetObjValue("ISPERSON", 1);
                }
            }
        }
Example #5
0
        private void CreateNonActionSubjectPost(T_FB_SUBJECTDEPTMENT sd, T_FB_SUBJECTPOST post, VirtualPost virtualPost)
        {
            ObservableCollection <FBEntity> listFBEntities = new ObservableCollection <FBEntity>();

            post.ACTIVED    = 0;
            post.UPDATEDATE = DateTime.Now;
            FBEntity fbEntityPostNew = post.ToFBEntity();

            fbEntityPostNew.FBEntityState = FBEntityState.Modified;
            listFBEntities.Add(fbEntityPostNew);
            FBEntity postFBEntity = virtualPost.ToFBEntity();

            postFBEntity.AddFBEntities <T_FB_SUBJECTPOST>(listFBEntities);
            OrderEntity entityPost = new OrderEntity(postFBEntity);

            EntityList.Add(entityPost);
        }
Example #6
0
        /// <summary>
        /// 获取T_FB_SUBJECTPOST信息
        /// </summary>
        /// <param name="strSubjectPostId">主键索引</param>
        /// <returns></returns>
        public T_FB_SUBJECTPOST GetSubjectPostByID(string strSubjectPostId)
        {
            if (string.IsNullOrEmpty(strSubjectPostId))
            {
                return(null);
            }

            SubjectPostDAL dalSubjectPost = new SubjectPostDAL();
            StringBuilder  strFilter      = new StringBuilder();
            List <string>  objArgs        = new List <string>();

            if (!string.IsNullOrEmpty(strSubjectPostId))
            {
                strFilter.Append(" SUBJECTPOSTID == @0");
                objArgs.Add(strSubjectPostId);
            }

            T_FB_SUBJECTPOST entRd = dalSubjectPost.GetSubjectPostRdByMultSearch(strFilter.ToString(), objArgs.ToArray());

            return(entRd);
        }
Example #7
0
        /// <summary>
        /// 新增岗位科目
        /// </summary>
        /// <param name="sd"></param>
        /// <returns></returns>
        private FBEntity CreateSubjectPost(T_FB_SUBJECTDEPTMENT sd, VirtualPost virtualPost, string strFlag)
        {
            T_FB_SUBJECTPOST post = new T_FB_SUBJECTPOST();

            post.T_FB_SUBJECTDEPTMENT = sd;
            post.T_FB_SUBJECT         = sd.T_FB_SUBJECT;
            post.LIMITBUDGEMONEY      = 0;
            post.SUBJECTPOSTID        = Guid.NewGuid().ToString();

            post.OWNERID           = DataCore.SuperUser.Value.ToString();
            post.OWNERPOSTID       = virtualPost.ID;
            post.OWNERDEPARTMENTID = virtualPost.OWNERDEPARTMENTID;
            post.OWNERCOMPANYID    = virtualPost.OWNERCOMPANYID;

            //岗位默认处理
            post = SubjectPostChanged(sd, post, strFlag);

            FBEntity fbEntityPostNew = post.ToFBEntity();

            fbEntityPostNew.FBEntityState = FBEntityState.Added;

            return(fbEntityPostNew);
        }
Example #8
0
        /// <summary>
        ///   保存科目设置流水
        /// </summary>
        /// <param name="fbEntityList"></param>
        /// <returns></returns>
        public bool SaveListT_FB_WFSUBJECTSETTING(List <FBEntity> fbEntityList, string strfig)
        {
            List <FBEntity> inActivedlist = fbEntityList.CreateList(item =>
            {
                T_FB_WFSUBJECTSETTING fbEntity = new T_FB_WFSUBJECTSETTING();

                if (strfig == "1")
                {
                    T_FB_SUBJECTCOMPANY SubjectEntity = item.Entity as T_FB_SUBJECTCOMPANY;

                    fbEntity.WFSUBJECTSETTINGID  = Guid.NewGuid().ToString();
                    fbEntity.SUBJECTID           = SubjectEntity.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString();
                    fbEntity.ACTIVED             = SubjectEntity.ACTIVED;
                    fbEntity.ISMONTHADJUST       = SubjectEntity.ISMONTHADJUST;
                    fbEntity.ISMONTHLIMIT        = SubjectEntity.ISMONTHLIMIT;
                    fbEntity.ISPERSON            = SubjectEntity.ISPERSON;
                    fbEntity.ISYEARBUDGET        = SubjectEntity.ISYEARBUDGET;
                    fbEntity.CONTROLTYPE         = SubjectEntity.CONTROLTYPE;
                    fbEntity.OWNERCOMPANYID      = SubjectEntity.OWNERCOMPANYID;
                    fbEntity.OWNERCOMPANYNAME    = SubjectEntity.OWNERCOMPANYNAME;
                    fbEntity.OWNERDEPARTMENTID   = SubjectEntity.OWNERDEPARTMENTID;
                    fbEntity.OWNERDEPARTMENTNAME = SubjectEntity.OWNERDEPARTMENTNAME;
                    fbEntity.OWNERPOSTID         = SubjectEntity.OWNERPOSTID;
                    fbEntity.OWNERPOSTNAME       = SubjectEntity.OWNERPOSTNAME;
                    fbEntity.CREATEUSERID        = SubjectEntity.CREATEUSERID;
                    fbEntity.UPDATEUSERID        = SubjectEntity.UPDATEUSERID;
                    fbEntity.UPDATEDATE          = DateTime.Now;
                    fbEntity.CREATEDATE          = DateTime.Now;
                    fbEntity.ORDERTYPE           = strfig;//1 公司 2部门 3岗位
                }
                else if (strfig == "2")
                {
                    T_FB_SUBJECTDEPTMENT SubjectEntity = item.Entity as T_FB_SUBJECTDEPTMENT;
                    if (SubjectEntity == null)
                    {
                        T_FB_SUBJECTPOST SubjectEntity1 = item.Entity as T_FB_SUBJECTPOST;

                        fbEntity.WFSUBJECTSETTINGID  = Guid.NewGuid().ToString();
                        fbEntity.SUBJECTID           = SubjectEntity1.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString();
                        fbEntity.ACTIVED             = SubjectEntity1.ACTIVED;
                        fbEntity.LIMITBUDGEMONEY     = SubjectEntity1.LIMITBUDGEMONEY;
                        fbEntity.OWNERCOMPANYID      = SubjectEntity1.OWNERCOMPANYID;
                        fbEntity.OWNERCOMPANYNAME    = SubjectEntity1.OWNERCOMPANYNAME;
                        fbEntity.OWNERDEPARTMENTID   = SubjectEntity1.OWNERDEPARTMENTID;
                        fbEntity.OWNERDEPARTMENTNAME = SubjectEntity1.OWNERDEPARTMENTNAME;
                        fbEntity.OWNERPOSTID         = SubjectEntity1.OWNERPOSTID;
                        fbEntity.OWNERPOSTNAME       = SubjectEntity1.OWNERPOSTNAME;
                        fbEntity.CREATEUSERID        = SubjectEntity1.CREATEUSERID;
                        fbEntity.UPDATEUSERID        = SubjectEntity1.UPDATEUSERID;
                        fbEntity.UPDATEDATE          = DateTime.Now;
                        fbEntity.CREATEDATE          = DateTime.Now;
                        fbEntity.ORDERTYPE           = "3";//1 公司 2部门 3岗位
                    }
                    else
                    {
                        fbEntity.WFSUBJECTSETTINGID  = Guid.NewGuid().ToString();
                        fbEntity.SUBJECTID           = SubjectEntity.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString();
                        fbEntity.ACTIVED             = SubjectEntity.ACTIVED;
                        fbEntity.LIMITBUDGEMONEY     = SubjectEntity.LIMITBUDGEMONEY;
                        fbEntity.OWNERCOMPANYID      = SubjectEntity.OWNERCOMPANYID;
                        fbEntity.OWNERCOMPANYNAME    = SubjectEntity.OWNERCOMPANYNAME;
                        fbEntity.OWNERDEPARTMENTID   = SubjectEntity.OWNERDEPARTMENTID;
                        fbEntity.OWNERDEPARTMENTNAME = SubjectEntity.OWNERDEPARTMENTNAME;
                        fbEntity.OWNERPOSTID         = SubjectEntity.OWNERPOSTID;
                        fbEntity.OWNERPOSTNAME       = SubjectEntity.OWNERPOSTNAME;
                        fbEntity.CREATEUSERID        = SubjectEntity.CREATEUSERID;
                        fbEntity.UPDATEUSERID        = SubjectEntity.UPDATEUSERID;
                        fbEntity.UPDATEDATE          = DateTime.Now;
                        fbEntity.CREATEDATE          = DateTime.Now;
                        fbEntity.ORDERTYPE           = strfig;//1 公司 2部门 3岗位
                    }
                }
                else if (strfig == "3")
                {
                    T_FB_SUBJECTPOST SubjectEntity = item.Entity as T_FB_SUBJECTPOST;

                    fbEntity.WFSUBJECTSETTINGID  = Guid.NewGuid().ToString();
                    fbEntity.SUBJECTID           = SubjectEntity.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString();
                    fbEntity.ACTIVED             = SubjectEntity.ACTIVED;
                    fbEntity.LIMITBUDGEMONEY     = SubjectEntity.LIMITBUDGEMONEY;
                    fbEntity.OWNERCOMPANYID      = SubjectEntity.OWNERCOMPANYID;
                    fbEntity.OWNERCOMPANYNAME    = SubjectEntity.OWNERCOMPANYNAME;
                    fbEntity.OWNERDEPARTMENTID   = SubjectEntity.OWNERDEPARTMENTID;
                    fbEntity.OWNERDEPARTMENTNAME = SubjectEntity.OWNERDEPARTMENTNAME;
                    fbEntity.OWNERPOSTID         = SubjectEntity.OWNERPOSTID;
                    fbEntity.OWNERPOSTNAME       = SubjectEntity.OWNERPOSTNAME;
                    fbEntity.CREATEUSERID        = SubjectEntity.CREATEUSERID;
                    fbEntity.UPDATEUSERID        = SubjectEntity.UPDATEUSERID;
                    fbEntity.UPDATEDATE          = DateTime.Now;
                    fbEntity.CREATEDATE          = DateTime.Now;
                    fbEntity.ORDERTYPE           = strfig;//1 公司 2部门 3岗位
                }
                FBEntity a      = new FBEntity();
                a.Entity        = fbEntity;
                a.FBEntityState = FBEntityState.Added;
                a.EntityKey     = null;
                return(a);
            });

            return(FBEntityBLLSaveList(inActivedlist));
        }
Example #9
0
        //岗位默认处理
        public T_FB_SUBJECTPOST SubjectPostChanged(T_FB_SUBJECTDEPTMENT sd, T_FB_SUBJECTPOST post, string strFlag)
        {
            if (strFlag == "ACTIVED")  //ACTIVED 用于区别启用事件点击和树的点击
            {
                if (sd.ACTIVED == 1)
                    post.ACTIVED = 1;
                else
                    post.ACTIVED = 0;

                if (sd.ISPERSON == 1)
                    post.ISPERSON = 1;
                else
                    post.ISPERSON = 0;
            }
            else if (strFlag == "MoneyAssign")
            {
                post.ACTIVED = 1;
                post.ISPERSON = 1;
            }

            return post;
        }
Example #10
0
 private void CreateNonActionSubjectPost(T_FB_SUBJECTDEPTMENT sd, T_FB_SUBJECTPOST post, VirtualPost virtualPost)
 {
     ObservableCollection<FBEntity> listFBEntities = new ObservableCollection<FBEntity>();
     post.ACTIVED = 0;
     post.UPDATEDATE = DateTime.Now;
     FBEntity fbEntityPostNew = post.ToFBEntity();
     fbEntityPostNew.FBEntityState = FBEntityState.Modified;
     listFBEntities.Add(fbEntityPostNew);
     FBEntity postFBEntity = virtualPost.ToFBEntity();
     postFBEntity.AddFBEntities<T_FB_SUBJECTPOST>(listFBEntities);
     OrderEntity entityPost = new OrderEntity(postFBEntity);
     EntityList.Add(entityPost);
 }
Example #11
0
        /// <summary>
        /// 新增岗位科目
        /// </summary>
        /// <param name="sd"></param>
        /// <returns></returns>
        private FBEntity CreateSubjectPost(T_FB_SUBJECTDEPTMENT sd, VirtualPost virtualPost, string strFlag)
        {
            T_FB_SUBJECTPOST post = new T_FB_SUBJECTPOST();
            post.T_FB_SUBJECTDEPTMENT = sd;
            post.T_FB_SUBJECT = sd.T_FB_SUBJECT;
            post.LIMITBUDGEMONEY = 0;
            post.SUBJECTPOSTID = Guid.NewGuid().ToString();

            post.OWNERID = DataCore.SuperUser.Value.ToString();
            post.OWNERPOSTID = virtualPost.ID;
            post.OWNERDEPARTMENTID = virtualPost.OWNERDEPARTMENTID;
            post.OWNERCOMPANYID = virtualPost.OWNERCOMPANYID;

            //岗位默认处理
            post = SubjectPostChanged(sd, post, strFlag);

            FBEntity fbEntityPostNew = post.ToFBEntity();
            fbEntityPostNew.FBEntityState = FBEntityState.Added;

            return fbEntityPostNew;
        }
Example #12
0
        /// <summary>
        /// 创建或获取相应岗位科目
        /// </summary>
        /// <param name="virtualPost"></param>
        /// <returns></returns>
        private OrderEntity CreatePostEntity(VirtualPost virtualPost, TreeViewItem treeViewItem, string strFlag)
        {
            ObservableCollection <FBEntity> listFBEntities = new ObservableCollection <FBEntity>();
            OrderEntity oeDepartment = dictDepartment[virtualPost.VirtualDepartment];

            // 已存在的岗位科目
            ObservableCollection <FBEntity> listOfSubjectDepartmentFB = oeDepartment.GetRelationFBEntities(typeof(T_FB_SUBJECTDEPTMENT).Name);

            // 1. 获取所有已启用的部门科目
            var itemsDepartmentActived = listOfSubjectDepartmentFB.Where(item =>
            {
                return((item.Entity as T_FB_SUBJECTDEPTMENT).ACTIVED == 1);
            });

            // 2. 遍历所有已启用的部门科目, 添加相应的岗位科目,已有科目的,则加上原有的,没有的,则新增

            foreach (FBEntity entityDepartment in itemsDepartmentActived)
            {
                T_FB_SUBJECTDEPTMENT sd = entityDepartment.Entity as T_FB_SUBJECTDEPTMENT;

                // 是否已有岗位科目的记录
                List <FBEntity> listPost = entityDepartment.GetRelationFBEntities(typeof(T_FB_SUBJECTPOST).Name, item =>
                {
                    return((item.Entity as T_FB_SUBJECTPOST).OWNERPOSTID == virtualPost.ID);
                });

                // 已有岗位科目,添加。没有,就新增
                if (listPost.Count > 0)
                {
                    T_FB_SUBJECTPOST post = listPost[0].Entity as T_FB_SUBJECTPOST;
                    if (post.ACTIVED != sd.ACTIVED)
                    {
                        listPost[0].FBEntityState = FBEntityState.Modified;
                    }
                    //岗位默认处理
                    if (post != null)
                    {
                        post = SubjectPostChanged(sd, post, strFlag);
                    }
                    listPost[0].Entity = post;
                    listFBEntities.Add(listPost[0]);
                }
                else
                {
                    //临时添加防止重复数据
                    var a = staticobpost.FirstOrDefault(item => (item.Entity as T_FB_SUBJECTPOST).OWNERPOSTID == virtualPost.ID && (item.Entity as T_FB_SUBJECTPOST).T_FB_SUBJECT != null && (item.Entity as T_FB_SUBJECTPOST).T_FB_SUBJECT.SUBJECTID == sd.T_FB_SUBJECT.SUBJECTID);
                    if (a == null && sd.ACTIVED == 1)
                    {
                        FBEntity fbEntityPostNew = this.CreateSubjectPost(sd, virtualPost, strFlag);
                        listFBEntities.Add(fbEntityPostNew);

                        staticobpost.Add(fbEntityPostNew);
                    }
                    else
                    {
                        listFBEntities.Add(a);
                    }
                }
            }

            FBEntity postFBEntity = virtualPost.ToFBEntity();

            postFBEntity.AddFBEntities <T_FB_SUBJECTPOST>(listFBEntities);
            OrderEntity entityPost = new OrderEntity(postFBEntity);

            Binding binding = new Binding();

            binding.Path = new PropertyPath("Entity.Name");
            treeViewItem.SetBinding(TreeViewItem.HeaderProperty, binding);
            treeViewItem.DataContext = entityPost;
            EntityList.Add(entityPost);
            return(entityPost);
        }
Example #13
0
        public void Save()
        {
            ObservableCollection <FBEntity> listOfFBEntity = new ObservableCollection <FBEntity>();

            for (int i = 0; i < EntityList.Count; i++)
            {
                OrderEntity item = EntityList[i];

                FBEntity fbEntitySave = item.GetModifiedFBEntity();
                ObservableCollection <FBEntity> listSave = null;
                if (fbEntitySave.Entity.GetType() == typeof(VirtualDepartment))
                {
                    listSave = fbEntitySave.GetRelationFBEntities(typeof(T_FB_SUBJECTDEPTMENT).Name);

                    //活动经费
                    // CheckMoneyAssign(listSave);
                }
                else
                {
                    listSave = fbEntitySave.GetRelationFBEntities(typeof(T_FB_SUBJECTPOST).Name);

                    // 删除 不是active的岗位项目记录
                    //listSave.RemoveAll(itemRemove =>
                    //{
                    //    bool isAdded = itemRemove.FBEntityState == FBEntityState.Added;
                    //  //  bool isNew = (itemRemove.Entity as T_FB_SUBJECTPOST).ACTIVED != 1;
                    //    //return isAdded && isNew;
                    //    return isAdded;
                    //});
                }

                listSave.ToList().ForEach(fbEntity =>
                {
                    bool tf = true;//外键为空的不处理
                    #region 公共参数赋值
                    if (fbEntity.IsNewEntity())
                    {
                        fbEntity.FBEntityState = FBEntityState.Added;


                        fbEntity.SetObjValue("Entity.CREATECOMPANYID", item.LoginUser.Company.Value);
                        fbEntity.SetObjValue("Entity.CREATECOMPANYNAME", item.LoginUser.Company.Text);
                        fbEntity.SetObjValue("Entity.CREATEDEPARTMENTID", item.LoginUser.Department.Value);
                        fbEntity.SetObjValue("Entity.CREATEDEPARTMENTNAME", item.LoginUser.Department.Text);
                        fbEntity.SetObjValue("Entity.CREATEPOSTID", item.LoginUser.Post.Value);
                        fbEntity.SetObjValue("Entity.CREATEPOSTNAME", item.LoginUser.Post.Text);
                        fbEntity.SetObjValue("Entity.CREATEUSERID", item.LoginUser.Value);
                        fbEntity.SetObjValue("Entity.CREATEUSERNAME", item.LoginUser.Text);

                        fbEntity.SetObjValue("Entity.EDITSTATES", decimal.Parse("1"));
                    }
                    fbEntity.SetObjValue("Entity.UPDATEUSERID", item.LoginUser.Value);
                    fbEntity.SetObjValue("Entity.UPDATEUSERNAME", item.LoginUser.Text);
                    #endregion

                    T_FB_SUBJECTPOST sp = fbEntity.Entity as T_FB_SUBJECTPOST;

                    // 去除实体之间的关联,如有关联存在,上传服务端时,会有异常
                    if (sp == null)
                    {
                        T_FB_SUBJECTDEPTMENT sd = fbEntity.Entity as T_FB_SUBJECTDEPTMENT;

                        if (sd.T_FB_SUBJECTCOMPANY != null && sd.T_FB_SUBJECT != null)
                        {
                            sd.T_FB_SUBJECTCOMPANYReference.EntityKey = sd.T_FB_SUBJECTCOMPANY.EntityKey;
                            sd.T_FB_SUBJECTCOMPANY = null;

                            sd.T_FB_SUBJECTReference.EntityKey = sd.T_FB_SUBJECT.EntityKey;
                            sd.T_FB_SUBJECT     = null;
                            sd.T_FB_SUBJECTPOST = null;
                            fbEntity.CollectionEntity.Clear();
                        }
                        else
                        {
                            tf = false;
                        }
                    }
                    else
                    {
                        if (sp.T_FB_SUBJECTDEPTMENT != null && sp.T_FB_SUBJECT != null)
                        {
                            EntityKey parentKey = sp.T_FB_SUBJECTDEPTMENT.EntityKey;
                            if (parentKey.EntityKeyValues == null)
                            {
                                EntityKeyMember em = new EntityKeyMember();
                                em.Key             = "SUBJECTDEPTMENTID";
                                em.Value           = sp.T_FB_SUBJECTDEPTMENT.SUBJECTDEPTMENTID;

                                EntityKey newKey           = new EntityKey();
                                newKey.EntityContainerName = parentKey.EntityContainerName;
                                newKey.EntitySetName       = parentKey.EntitySetName;
                                newKey.EntityKeyValues     = new ObservableCollection <EntityKeyMember>();
                                newKey.EntityKeyValues.Add(em);
                                parentKey = newKey;
                            }
                            sp.T_FB_SUBJECTDEPTMENTReference           = new EntityReferenceOfT_FB_SUBJECTDEPTMENTZ5CrhPbu();
                            sp.T_FB_SUBJECTDEPTMENTReference.EntityKey = parentKey;
                            sp.T_FB_SUBJECTDEPTMENT = null;

                            sp.T_FB_SUBJECTReference           = new EntityReferenceOfT_FB_SUBJECTZ5CrhPbu();
                            sp.T_FB_SUBJECTReference.EntityKey = sp.T_FB_SUBJECT.EntityKey;
                            sp.T_FB_SUBJECT = null;

                            // 清除已删除实体,这些实体会在 T_FB_SUBJECTDEPTMENT 实体中处理 .
                            fbEntity.GetRelationFBEntities(Args.DELETE_ENTITYTYPE).Clear();
                        }
                        else
                        {
                            tf = false;
                        }
                    }
                    if (tf)
                    {
                        listOfFBEntity.Add(fbEntity);
                    }
                });
            }

            if (listOfFBEntity.Count > 0)
            {
                this.CurrentOrderEntity = new OrderEntity(typeof(VirtualCompany));


                this.orderEntityService.SaveList(listOfFBEntity);
            }
            else
            {
                CloseProcess();
            }
        }
Example #14
0
 public static T_FB_SUBJECTPOST CreateT_FB_SUBJECTPOST(string sUBJECTPOSTID, decimal aCTIVED, string oWNERID, string oWNERPOSTID, string oWNERDEPARTMENTID, string oWNERCOMPANYID, string cREATEUSERID, global::System.DateTime cREATEDATE, string cREATECOMPANYID, string cREATEDEPARTMENTID, string cREATEPOSTID, string uPDATEUSERID, global::System.DateTime uPDATEDATE, decimal eDITSTATES)
 {
     T_FB_SUBJECTPOST t_FB_SUBJECTPOST = new T_FB_SUBJECTPOST();
     t_FB_SUBJECTPOST.SUBJECTPOSTID = sUBJECTPOSTID;
     t_FB_SUBJECTPOST.ACTIVED = aCTIVED;
     t_FB_SUBJECTPOST.OWNERID = oWNERID;
     t_FB_SUBJECTPOST.OWNERPOSTID = oWNERPOSTID;
     t_FB_SUBJECTPOST.OWNERDEPARTMENTID = oWNERDEPARTMENTID;
     t_FB_SUBJECTPOST.OWNERCOMPANYID = oWNERCOMPANYID;
     t_FB_SUBJECTPOST.CREATEUSERID = cREATEUSERID;
     t_FB_SUBJECTPOST.CREATEDATE = cREATEDATE;
     t_FB_SUBJECTPOST.CREATECOMPANYID = cREATECOMPANYID;
     t_FB_SUBJECTPOST.CREATEDEPARTMENTID = cREATEDEPARTMENTID;
     t_FB_SUBJECTPOST.CREATEPOSTID = cREATEPOSTID;
     t_FB_SUBJECTPOST.UPDATEUSERID = uPDATEUSERID;
     t_FB_SUBJECTPOST.UPDATEDATE = uPDATEDATE;
     t_FB_SUBJECTPOST.EDITSTATES = eDITSTATES;
     return t_FB_SUBJECTPOST;
 }
Example #15
0
 public void AddToT_FB_SUBJECTPOST(T_FB_SUBJECTPOST t_FB_SUBJECTPOST)
 {
     base.AddObject("T_FB_SUBJECTPOST", t_FB_SUBJECTPOST);
 }