public SCAclContainer(SchemaObjectBase container) { container.NullCheck("container"); this.ContainerID = container.ID; this.ContainerSchemaType = container.SchemaType; }
public static ClientSchemaObjectBase ToClientSchemaObjectBaseObject(this SchemaObjectBase pcObject) { pcObject.NullCheck("pcObject"); ClientSchemaObjectBase result; if (pcObject is SCRelationObject) { result = new ClientSchemaRelation(); } else if (pcObject is SCMemberRelation) { result = new ClientSchemaMember(); result.SchemaType = pcObject.SchemaType; FillPropertiesFromPC(((ClientSchemaMember)result), (SCMemberRelation)pcObject); } else { result = CreateClientBaseObject(pcObject.SchemaType); } result.ID = pcObject.ID; result.Status = (ClientSchemaObjectStatus)pcObject.Status; result.VersionStartTime = pcObject.VersionStartTime; result.VersionEndTime = pcObject.VersionEndTime; pcObject.Properties.CopyTo(result.Properties); if (pcObject.Creator != null && string.IsNullOrEmpty(pcObject.Creator.ID) == false) { result.Creator = new ClientOguUser(pcObject.Creator); } return(result); }
public static ClientSchemaObjectBase ToClientSchemaObject(this SchemaObjectBase pcObject) { pcObject.NullCheck("pcObject"); if (pcObject is SCBase) { return(ToClientSCBaseObject((SCBase)pcObject)); } else { if (pcObject is SCRelationObject) { return(((SCRelationObject)pcObject).ToClientSchemaObject()); } else if (pcObject is SCMemberRelation) { return(((SCMemberRelation)pcObject).ToClientSchemaObject()); } else if (pcObject is SCSecretaryRelation) { return(((SCSecretaryRelation)pcObject).ToClientSchemaObject()); } else { throw new NotSupportedException("不支持关系等对象"); } } }
public AUObjectExecutor(AUOperationType opType, SchemaObjectBase data) : base(opType) { data.NullCheck("data"); data.ClearRelativeData(); this._Data = data; }
public SCAclItem(string containerPermission, SchemaObjectBase member) { member.NullCheck("member"); containerPermission.CheckStringIsNullOrEmpty("containerPermission"); this.MemberID = member.ID; this.MemberSchemaType = member.SchemaType; this.ContainerPermission = containerPermission; }
public SCUpdateObjectImageExecutor(SCOperationType opType, SchemaObjectBase obj, string propertyName, ImageProperty image) : base(opType) { obj.NullCheck("obj"); propertyName.IsNullOrEmpty().TrueThrow("propertyName不能为空!"); this._Object = obj; this._PropertyName = propertyName; this._Image = image; }
public SchemaObjectBase DoOperation(SCObjectOperationMode opMode, SchemaObjectBase data, SchemaObjectBase parent, bool deletedByContainer = false) { data.NullCheck("data"); SchemaOperationDefine sod = data.Schema.Operations[opMode]; (sod != null).FalseThrow("不能找到Schema类型为{0},操作为{1}的方法定义", data.SchemaType, opMode); return(this.DoOperation(sod, data, parent, deletedByContainer)); }
public AUMemberRelativeExecutorBase(AUOperationType opType, SchemaObjectBase container, SchemaObjectBase member) : base(opType, member) { container.NullCheck("container"); container.ClearRelativeData(); if (member != null) member.ClearRelativeData(); this._Container = container; this._Relation = PrepareRelationObject(container, member); }
/// <summary> /// 递归获取所有子对象的关系 /// </summary> /// <param name="obj"></param> /// <param name="handler"></param> /// <param name="context"></param> /// <returns></returns> public SCSimpleRelationObjectCollection LoadAllChildrenRelationsRecursively(SchemaObjectBase obj, LoadingRelationsRecursivelyHandler handler, object context) { obj.NullCheck("obj"); SCSimpleRelationObjectCollection result = new SCSimpleRelationObjectCollection(); InSqlClauseBuilder builder = new InSqlClauseBuilder("ParentID"); builder.AppendItem(obj.ID); FillAllChildrenRelationsRecursively(result, builder, handler, context); return(result); }
public AUMemberRelativeExecutorBase(AUOperationType opType, SchemaObjectBase container, SchemaObjectBase member) : base(opType, member) { container.NullCheck("container"); container.ClearRelativeData(); if (member != null) { member.ClearRelativeData(); } this._Container = container; this._Relation = PrepareRelationObject(container, member); }
/// <summary> /// 创建一个基本的日志 /// </summary> /// <param name="data"></param> /// <param name="opType"></param> /// <param name="message"></param> /// <returns></returns> internal static Logs.AUOperationLog ToOperationLog(this SchemaObjectBase data, Executors.AUOperationType opType, string message) { data.NullCheck("data"); AUOperationLog log = AUOperationLog.CreateLogFromEnvironment(); log.ResourceID = data.ID; log.SchemaType = data.SchemaType; log.OperationType = opType; log.Category = data.Schema.Category; log.Subject = message; log.SearchContent = data.ToFullTextString(); return(log); }
/// <summary> /// 构造一个生成FullPath的作业 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static SCToDoJob CreateGenerateFullPathsJob(SchemaObjectBase obj) { obj.NullCheck("obj"); SCToDoJob job = new SCToDoJob(); job.Type = "GenerateFullPaths"; if (obj != null) { job.SourceID = obj.ID; job.Description = string.Format("Generate full paths from '{0}'", obj.ID); job.Data = obj.ToString(); } return(job); }
/// <summary> /// 构造一个生成FullPath的作业 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static SCToDoJob CreateGenerateFullPathsJob(SchemaObjectBase obj) { obj.NullCheck("obj"); SCToDoJob job = new SCToDoJob(); job.Type = "GenerateFullPaths"; if (obj != null) { job.SourceID = obj.ID; job.Description = string.Format("Generate full paths from '{0}'", obj.ID); job.Data = obj.ToString(); } return job; }
private static void FillCommon(SchemaObjectBase pcObj, ClientSchemaObjectBase clientObj) { pcObj.NullCheck("pcObj"); clientObj.NullCheck("clientObj"); clientObj.ID = pcObj.ID; clientObj.CreateDate = pcObj.CreateDate; clientObj.SchemaType = pcObj.SchemaType; clientObj.Status = (ClientSchemaObjectStatus)pcObj.Status; clientObj.VersionEndTime = pcObj.VersionEndTime; clientObj.VersionStartTime = pcObj.VersionStartTime; if (pcObj.Creator != null) { clientObj.Creator = new ClientOguUser() { DisplayName = string.IsNullOrEmpty(pcObj.Creator.DisplayName) ? pcObj.Creator.Name : pcObj.Creator.DisplayName, ID = pcObj.Creator.ID }; } pcObj.Properties.CopyTo(clientObj.Properties); }
public SchemaObjectBase DoOperation(SCObjectOperationMode opMode, SchemaObjectBase data, SchemaObjectBase parent, bool deletedByContainer = false) { data.NullCheck("data"); SchemaOperationDefine sod = data.Schema.Operations[opMode]; (sod != null).FalseThrow("不能找到Schema类型为{0},操作为{1}的方法定义", data.SchemaType, opMode); return this.DoOperation(sod, data, parent, deletedByContainer); }