void DeatilEntity_PropertyChanged(object sender, PropertyChangedEventArgs e) { T_FB_SUBJECTCOMPANY aa = sender as T_FB_SUBJECTCOMPANY; //sender.SetObjValue("ACTIVED", 1); sender.SetObjValue("ISYEARBUDGET", 1); sender.SetObjValue("ISMONTHLIMIT", 1); sender.SetObjValue("ISPERSON", 1); sender.SetObjValue("CONTROLTYPE", 3); }
void DeatilEntity_PropertyChanged(object sender, PropertyChangedEventArgs e) { T_FB_SUBJECTCOMPANY aa = sender as T_FB_SUBJECTCOMPANY; if (aa.ACTIVED != 1 || aa.ISYEARBUDGET != 1 || aa.ISMONTHLIMIT != 1 || aa.ISPERSON != 1) { ComfirmWindow.ConfirmationBoxs("提示", "活动经费只能是启用、年度受控、月度受控、启用分配个人,并且修改无效。", Utility.GetResourceStr("CONFIRM"), MessageIcon.Question); // CommonFunction.ShowErrorMessage("活动经费只能是启用、年度受控、月度受控、启用分配个人,并且修改无效。"); } sender.SetObjValue("ACTIVED", 1); sender.SetObjValue("ISYEARBUDGET", 1); sender.SetObjValue("ISMONTHLIMIT", 1); sender.SetObjValue("ISPERSON", 1); sender.SetObjValue("CONTROLTYPE", 3); }
/// <summary> /// 获取T_FB_SUBJECTCOMPANY信息 /// </summary> /// <param name="strSubjectCompanyId">主键索引</param> /// <returns></returns> public T_FB_SUBJECTCOMPANY GetSubjectCompanyByID(string strSubjectCompanyId) { if (string.IsNullOrEmpty(strSubjectCompanyId)) { return(null); } SubjectCompanyDAL dalSubjectCompany = new SubjectCompanyDAL(); StringBuilder strFilter = new StringBuilder(); List <string> objArgs = new List <string>(); if (!string.IsNullOrEmpty(strSubjectCompanyId)) { strFilter.Append(" SUBJECTCOMPANYID == @0"); objArgs.Add(strSubjectCompanyId); } T_FB_SUBJECTCOMPANY entRd = dalSubjectCompany.GetSubjectCompanyRdByMultSearch(strFilter.ToString(), objArgs.ToArray()); return(entRd); }
/// <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)); }
/// <summary> /// 保存公司科目维护 /// 级联的去除不可用的部门科目和岗位科目 /// </summary> /// <param name="fbEntityList"></param> /// <returns></returns> public bool SaveListT_FB_SUBJECTCOMPANY(List <FBEntity> fbEntityList) { QueryExpression qeSCom = new QueryExpression(); QueryExpression qeTop = qeSCom; string StrCompanyID = "";//公司ID bool IsExistPlus = false; // 找出没有设置年度预算而后又允许年度预算的 List <T_FB_SUBJECTCOMPANY> inActivedlist = fbEntityList.CreateList(item => { T_FB_SUBJECTCOMPANY entity = item.Entity as T_FB_SUBJECTCOMPANY; if (string.IsNullOrEmpty(StrCompanyID)) { StrCompanyID = entity.OWNERCOMPANYID; QueryExpression qe = QueryExpression.Equal("SUBJECTCOMPANYID", entity.SUBJECTCOMPANYID); var baData = this.InnerGetEntities <T_FB_SUBJECTCOMPANY>(qe); if (baData.Count() > 0) { T_FB_SUBJECTCOMPANY OldSub = new T_FB_SUBJECTCOMPANY(); OldSub = baData.FirstOrDefault(); if (OldSub.ISYEARBUDGET == 0) { if (entity.ISYEARBUDGET == 1) { QueryExpression qeAccount = QueryExpression.Equal("OWNERCOMPANYID", entity.OWNERCOMPANYID); QueryExpression qeAccount1 = QueryExpression.Equal("T_FB_SUBJECT.SUBJECTID", entity.T_FB_SUBJECT != null ? entity.T_FB_SUBJECT.SUBJECTID : entity.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString()); QueryExpression qeAccount2 = QueryExpression.Equal("ACCOUNTOBJECTTYPE", "1"); QueryExpression qeAccount3 = new QueryExpression(); qeAccount3.PropertyName = "USABLEMONEY"; qeAccount3.PropertyValue = "0"; qeAccount3.Operation = QueryExpression.Operations.LessThanOrEqual; qeAccount3.Operation = QueryExpression.Operations.LessThan;//是否有问题 qeAccount.RelatedType = QueryExpression.RelationType.And; qeAccount1.RelatedType = QueryExpression.RelationType.And; qeAccount2.RelatedType = QueryExpression.RelationType.And; qeAccount3.RelatedType = QueryExpression.RelationType.And; qeAccount.RelatedExpression = qeAccount1; qeAccount2.RelatedExpression = qeAccount1; qeAccount3.RelatedExpression = qeAccount2; qeAccount3.QueryType = typeof(T_FB_BUDGETACCOUNT).Name; //var baDataAccount = this.InnerGetEntities<T_FB_BUDGETACCOUNT>(qeAccount); //if(baDataAccount.Count() >0) //{ // //IsExistPlus= true; //} } } } } //return entity.ACTIVED != 1 ? entity : null; return(entity); }); if (IsExistPlus) { return(IsExistPlus); } //var baData = this.InnerGetEntities<T_FB_SUBJECTCOMPANY>(qeDept); // 查出公司科目相关的部门科目及岗位科目 inActivedlist.ForEach(item => { qeTop.RelatedExpression = QueryExpression.Equal("T_FB_SUBJECTCOMPANY.SUBJECTCOMPANYID", item.SUBJECTCOMPANYID); qeTop.RelatedType = QueryExpression.RelationType.Or; qeTop = qeTop.RelatedExpression; }); // 将部门科目及岗位科目置为不可用 if (qeSCom.RelatedExpression != null) { qeSCom = qeSCom.RelatedExpression; qeSCom.Include = new string[] { "T_FB_SUBJECTPOST" }; List <T_FB_SUBJECTDEPTMENT> inActiveDataList = GetEntities <T_FB_SUBJECTDEPTMENT>(qeSCom.RelatedExpression); inActiveDataList.ForEach(item => { item.ACTIVED = 0; item.T_FB_SUBJECTPOST.ToList().ForEach(itemPost => { itemPost.ACTIVED = 0; }); }); } if (fbEntityList.Count > 0) { //记录公司部门科目设置修改流水 SaveListT_FB_WFSUBJECTSETTING(fbEntityList, "1"); } return(FBEntityBLLSaveList(fbEntityList)); }
/// <summary> /// 保存公司科目维护 /// 级联的去除不可用的部门科目和岗位科目 /// </summary> /// <param name="fbEntityList"></param> /// <returns></returns> public bool SaveListT_FB_SUBJECTCOMPANY(List<FBEntity> fbEntityList) { QueryExpression qeSCom = new QueryExpression(); QueryExpression qeTop = qeSCom; string StrCompanyID = "";//公司ID bool IsExistPlus = false; // 找出没有设置年度预算而后又允许年度预算的 List<T_FB_SUBJECTCOMPANY> inActivedlist = fbEntityList.CreateList(item => { T_FB_SUBJECTCOMPANY entity = item.Entity as T_FB_SUBJECTCOMPANY; if (string.IsNullOrEmpty(StrCompanyID)) { StrCompanyID = entity.OWNERCOMPANYID; QueryExpression qe = QueryExpression.Equal("SUBJECTCOMPANYID", entity.SUBJECTCOMPANYID); var baData = this.InnerGetEntities<T_FB_SUBJECTCOMPANY>(qe); if (baData.Count() > 0) { T_FB_SUBJECTCOMPANY OldSub = new T_FB_SUBJECTCOMPANY(); OldSub = baData.FirstOrDefault(); if (OldSub.ISYEARBUDGET == 0) { if (entity.ISYEARBUDGET == 1) { QueryExpression qeAccount = QueryExpression.Equal("OWNERCOMPANYID", entity.OWNERCOMPANYID); QueryExpression qeAccount1 = QueryExpression.Equal("T_FB_SUBJECT.SUBJECTID", entity.T_FB_SUBJECT != null ? entity.T_FB_SUBJECT.SUBJECTID : entity.T_FB_SUBJECTReference.EntityKey.EntityKeyValues[0].Value.ToString()); QueryExpression qeAccount2 = QueryExpression.Equal("ACCOUNTOBJECTTYPE", "1"); QueryExpression qeAccount3 = new QueryExpression(); qeAccount3.PropertyName = "USABLEMONEY"; qeAccount3.PropertyValue = "0"; qeAccount3.Operation = QueryExpression.Operations.LessThanOrEqual; qeAccount3.Operation = QueryExpression.Operations.LessThan;//是否有问题 qeAccount.RelatedType = QueryExpression.RelationType.And; qeAccount1.RelatedType = QueryExpression.RelationType.And; qeAccount2.RelatedType = QueryExpression.RelationType.And; qeAccount3.RelatedType = QueryExpression.RelationType.And; qeAccount.RelatedExpression = qeAccount1; qeAccount2.RelatedExpression = qeAccount1; qeAccount3.RelatedExpression = qeAccount2; qeAccount3.QueryType = typeof(T_FB_BUDGETACCOUNT).Name; //var baDataAccount = this.InnerGetEntities<T_FB_BUDGETACCOUNT>(qeAccount); //if(baDataAccount.Count() >0) //{ // //IsExistPlus= true; //} } } } } //return entity.ACTIVED != 1 ? entity : null; return entity; }); if (IsExistPlus) { return IsExistPlus; } //var baData = this.InnerGetEntities<T_FB_SUBJECTCOMPANY>(qeDept); // 查出公司科目相关的部门科目及岗位科目 inActivedlist.ForEach(item => { qeTop.RelatedExpression = QueryExpression.Equal("T_FB_SUBJECTCOMPANY.SUBJECTCOMPANYID", item.SUBJECTCOMPANYID); qeTop.RelatedType = QueryExpression.RelationType.Or; qeTop = qeTop.RelatedExpression; }); // 将部门科目及岗位科目置为不可用 if (qeSCom.RelatedExpression != null) { qeSCom = qeSCom.RelatedExpression; qeSCom.Include = new string[] { "T_FB_SUBJECTPOST" }; List<T_FB_SUBJECTDEPTMENT> inActiveDataList = GetEntities<T_FB_SUBJECTDEPTMENT>(qeSCom.RelatedExpression); inActiveDataList.ForEach(item => { item.ACTIVED = 0; item.T_FB_SUBJECTPOST.ToList().ForEach(itemPost => { itemPost.ACTIVED = 0; }); }); } if (fbEntityList.Count > 0) { //记录公司部门科目设置修改流水 SaveListT_FB_WFSUBJECTSETTING(fbEntityList, "1"); } return FBEntityBLLSaveList(fbEntityList); }
public static T_FB_SUBJECTCOMPANY CreateT_FB_SUBJECTCOMPANY(string sUBJECTCOMPANYID, 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_SUBJECTCOMPANY t_FB_SUBJECTCOMPANY = new T_FB_SUBJECTCOMPANY(); t_FB_SUBJECTCOMPANY.SUBJECTCOMPANYID = sUBJECTCOMPANYID; t_FB_SUBJECTCOMPANY.ACTIVED = aCTIVED; t_FB_SUBJECTCOMPANY.OWNERID = oWNERID; t_FB_SUBJECTCOMPANY.OWNERPOSTID = oWNERPOSTID; t_FB_SUBJECTCOMPANY.OWNERDEPARTMENTID = oWNERDEPARTMENTID; t_FB_SUBJECTCOMPANY.OWNERCOMPANYID = oWNERCOMPANYID; t_FB_SUBJECTCOMPANY.CREATEUSERID = cREATEUSERID; t_FB_SUBJECTCOMPANY.CREATEDATE = cREATEDATE; t_FB_SUBJECTCOMPANY.CREATECOMPANYID = cREATECOMPANYID; t_FB_SUBJECTCOMPANY.CREATEDEPARTMENTID = cREATEDEPARTMENTID; t_FB_SUBJECTCOMPANY.CREATEPOSTID = cREATEPOSTID; t_FB_SUBJECTCOMPANY.UPDATEUSERID = uPDATEUSERID; t_FB_SUBJECTCOMPANY.UPDATEDATE = uPDATEDATE; t_FB_SUBJECTCOMPANY.EDITSTATES = eDITSTATES; return t_FB_SUBJECTCOMPANY; }
public void AddToT_FB_SUBJECTCOMPANY(T_FB_SUBJECTCOMPANY t_FB_SUBJECTCOMPANY) { base.AddObject("T_FB_SUBJECTCOMPANY", t_FB_SUBJECTCOMPANY); }
private void Save() { ObservableCollection <FBEntity> listOfFBEntity = new ObservableCollection <FBEntity>(); for (int i = 0; i < EntityList.Count; i++) { OrderEntity item = EntityList[i]; FBEntity fbEntitySave = item.GetModifiedFBEntity(); fbEntitySave.CollectionEntity[0].FBEntities.ToList().ForEach(fbEntity => { T_FB_SUBJECTCOMPANY sc = fbEntity.Entity as T_FB_SUBJECTCOMPANY; if (fbEntity.Entity.EntityKey.EntityKeyValues == null) { fbEntity.FBEntityState = FBEntityState.Added; fbEntity.Entity.EntityKey = null; fbEntity.SetObjValue("Entity.SUBJECTCOMPANYID", Guid.NewGuid().ToString()); 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.OWNERCOMPANYID", item.GetObjValue("Entity.OWNERCOMPANYID")); fbEntity.SetObjValue("Entity.OWNERCOMPANYNAME", item.GetObjValue("Entity.OWNERCOMPANYNAME")); fbEntity.SetObjValue("Entity.OWNERDEPARTMENTID", item.LoginUser.Department.Value); fbEntity.SetObjValue("Entity.OWNERDEPARTMENTNAME", item.LoginUser.Department.Text); fbEntity.SetObjValue("Entity.OWNERPOSTID", item.LoginUser.Post.Value); fbEntity.SetObjValue("Entity.OWNERPOSTNAME", item.LoginUser.Post.Text); fbEntity.SetObjValue("Entity.OWNERID", item.LoginUser.Value); fbEntity.SetObjValue("Entity.OWNERNAME", item.LoginUser.Text); fbEntity.SetObjValue("Entity.EDITSTATES", decimal.Parse("1")); } else { //if (sc.ACTIVED != 1) //{ // fbEntity.FBEntityState = FBEntityState.Detached; //} } fbEntity.SetObjValue("Entity.UPDATEUSERID", item.LoginUser.Value); fbEntity.SetObjValue("Entity.UPDATEUSERNAME", item.LoginUser.Text); sc.T_FB_SUBJECTReference.EntityKey = sc.T_FB_SUBJECT.EntityKey; sc.T_FB_SUBJECT = null; sc.T_FB_SUBJECTDEPTMENT = new ObservableCollection <T_FB_SUBJECTDEPTMENT>(); listOfFBEntity.Add(fbEntity); }); } if (listOfFBEntity.Count > 0) { this.CurrentOrderEntity = new OrderEntity(typeof(VirtualCompany)); this.orderEntityService.SaveList(listOfFBEntity); } else { CloseProcess(); } }