public static SCAclItem ToSCAcl(this ClientAclItem clientAcl) { clientAcl.NullCheck("pcAcl"); SCAclItem result = new SCAclItem() { ContainerID = clientAcl.ContainerID, ContainerPermission = clientAcl.ContainerPermission, ContainerSchemaType = clientAcl.ContainerSchemaType, MemberID = clientAcl.MemberID, MemberSchemaType = clientAcl.MemberSchemaType, SortID = clientAcl.SortID, VersionEndTime = clientAcl.VersionStartTime, VersionStartTime = clientAcl.VersionEndTime, Status = (SchemaObjectStatus)clientAcl.Status }; return(result); }
public static ClientAclItem ToClientObject(this SCAclItem pcAcl) { pcAcl.NullCheck("pcAcl"); ClientAclItem result = new ClientAclItem() { ContainerID = pcAcl.ContainerID, ContainerPermission = pcAcl.ContainerPermission, ContainerSchemaType = pcAcl.ContainerSchemaType, MemberID = pcAcl.MemberID, MemberSchemaType = pcAcl.MemberSchemaType, SortID = pcAcl.SortID, VersionEndTime = pcAcl.VersionStartTime, VersionStartTime = pcAcl.VersionEndTime, Status = (ClientSchemaObjectStatus)pcAcl.Status }; return(result); }
private void WriteAcls(System.Xml.XmlWriter writer, SCAclItem acl) { writer.WriteStartElement("acl"); writer.WriteStartAttribute("ContainerID"); writer.WriteValue(acl.ContainerID); writer.WriteEndAttribute(); writer.WriteStartAttribute("ContainerPermission"); writer.WriteValue(acl.ContainerPermission); writer.WriteEndAttribute(); writer.WriteStartAttribute("ContainerSchemaType"); writer.WriteValue(acl.ContainerSchemaType); writer.WriteEndAttribute(); writer.WriteStartAttribute("MemberID"); writer.WriteValue(acl.MemberID); writer.WriteEndAttribute(); writer.WriteStartAttribute("MemberSchemaType"); writer.WriteValue(acl.MemberSchemaType); writer.WriteEndAttribute(); writer.WriteStartAttribute("SortID"); writer.WriteValue(acl.SortID); writer.WriteEndAttribute(); writer.WriteStartAttribute("VersionEndTime"); writer.WriteValue(acl.VersionEndTime); writer.WriteEndAttribute(); writer.WriteStartAttribute("VersionStartTime"); writer.WriteValue(acl.VersionStartTime); writer.WriteEndAttribute(); writer.WriteEndElement(); }
private string GetUpdateSql(string containerID, SCAclContainerOrMemberCollectionBase members) { return(VersionStrategyUpdateSqlHelper.ConstructUpdateSql( null, (strB, context) => { string tableName = this.GetMappingInfo().TableName; ConnectiveSqlClauseCollection connectiveBuilder = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder(); WhereSqlClauseBuilder keyBuilder = new WhereSqlClauseBuilder(); keyBuilder.AppendItem("ContainerID", containerID); connectiveBuilder.Add(keyBuilder); strB.AppendFormat( "UPDATE {0} SET VersionEndTime = {1} WHERE {2}", tableName, "@currentTime", connectiveBuilder.ToSqlString(TSqlBuilder.Instance)); for (int i = 0; i < members.Count; i++) { SCAclItem aclitem = members[i]; aclitem.SortID = i; strB.Append(TSqlBuilder.Instance.DBStatementSeperator); aclitem.VersionEndTime = ConnectionDefine.MaxVersionEndTime; InsertSqlClauseBuilder insertBuilder = ORMapping.GetInsertSqlClauseBuilder(aclitem, this.GetMappingInfo(), "VersionStartTime"); insertBuilder.AppendItem("VersionStartTime", "@currentTime", "=", true); strB.AppendFormat("INSERT INTO {0}{1}", tableName, insertBuilder.ToSqlString(TSqlBuilder.Instance)); } })); }