protected override object DoOperation(SchemaObjectOperationContext context) { if (this._RelationExisted == false) { if (this._OriginalRelation.Status == SchemaObjectStatus.Normal) { this._OriginalRelation.Status = SchemaObjectStatus.Deleted; SchemaRelationObjectAdapter.Instance.Update(this._OriginalRelation); } SchemaRelationObjectAdapter.Instance.Update(this._TargetRelation); if (this.NeedChangeOwner) { SchemaObjectAdapter.Instance.Update(this._Object); } if (this._NeedGenerateFullPaths) { SCToDoJobListAdapter.Instance.Insert(SCToDoJob.CreateGenerateFullPathsJob(this._Object)); } } return(this._TargetRelation); }
protected override object DoOperation(AUObjectOperationContext context) { if (this._RelationExisted == false) { if (this._OriginalRelation.Status == SchemaObjectStatus.Normal) { this._OriginalRelation.Status = SchemaObjectStatus.Deleted; AUCommon.DoDbAction(() => SchemaRelationObjectAdapter.Instance.UpdateStatus(this._OriginalRelation, SchemaObjectStatus.Deleted)); } AUCommon.DoDbAction(() => SchemaRelationObjectAdapter.Instance.Update(this._TargetRelation)); //if (this.NeedChangeOwner) // SchemaObjectAdapter.Instance.Update(this._Object); if (this._NeedGenerateFullPaths) { AUCommon.DoDbAction(() => SCToDoJobListAdapter.Instance.Insert(SCToDoJob.CreateGenerateFullPathsJob(this._Object))); } } return(this._TargetRelation); }
/// <summary> /// 处理相关数据 /// </summary> /// <param name="context"></param> protected void DoRelativeDataOperation(SchemaObjectOperationContext context) { if (this._ObjectNameChanged) { if (context.ContainsKey("parentRelations")) { UpdateRelations((IEnumerable <SCRelationObject>)context["parentRelations"]); } } if (this._NeedDeleteRelations) { if (context.ContainsKey("childrenRelations")) { UpdateRelationsStatus((IEnumerable <SCRelationObject>)context["childrenRelations"]); } if (context.ContainsKey("parentRelations")) { UpdateRelationsStatus((IEnumerable <SCRelationObject>)context["parentRelations"]); } } if (context.ContainsKey("containersRelations")) { UpdateMembersRelationsStatus((IEnumerable <SCSimpleRelationBase>)context["containersRelations"]); } if (context.ContainsKey("membersRelations")) { UpdateMembersRelationsStatus((IEnumerable <SCSimpleRelationBase>)context["membersRelations"]); } if (context.ContainsKey("aclMembers")) { SCAclAdapter.Instance.UpdateStatus(((SCAclContainerOrMemberCollectionBase)context["aclMembers"]), SchemaObjectStatus.Deleted); } if (context.ContainsKey("aclContainers")) { SCAclAdapter.Instance.UpdateStatus(((SCAclContainerOrMemberCollectionBase)context["aclContainers"]), SchemaObjectStatus.Deleted); } if (this._NeedGenerateFullPaths) { SCToDoJobListAdapter.Instance.Insert(SCToDoJob.CreateGenerateFullPathsJob(this.Data)); } if (this._NeedDeleteConditions && this.Data is ISCUserContainerWithConditionObject && this.Data.Status != SchemaObjectStatus.Normal) { SCConditionAdapter.Instance.DeleteByOwner(this.Data.ID, "Default"); } }