Ejemplo n.º 1
0
        /// <summary>
        /// 获取根关系对象
        /// </summary>
        /// <returns>一个表示根关系的<see cref="SCRelationObject"/>对象</returns>
        public static SCRelationObject GetRootRelationObject()
        {
            SCRelationObject result = new SCRelationObject();

            result.ParentSchemaType = StandardObjectSchemaType.Organizations.ToString();
            result.ID              = RootOrganizationID;
            result.InnerSort       = 0;
            result.ChildSchemaType = StandardObjectSchemaType.Organizations.ToString();
            result.FullPath        = string.Empty;
            result.GlobalSort      = string.Empty;

            return(result);
        }
Ejemplo n.º 2
0
        public SchemaObjectCollection GetCurrentUsers()
        {
            SchemaObjectCollection result = null;

            SCRelationObject relation = this.CurrentParentRelations.FirstOrDefault();

            if (relation != null)
            {
                SCObjectAndRelationCollection objsAndRelations = SCSnapshotAdapter.Instance.QueryObjectAndRelationByParentFullPath(
                    SchemaInfo.FilterByCategory("Users").ToSchemaNames(), new string[] { relation.FullPath }, true, true, false, DateTime.MinValue);

                result = objsAndRelations.ToSchemaObjects();
            }
            else
            {
                result = new SchemaObjectCollection();
            }

            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 得到根对象的实例
        /// </summary>
        /// <returns></returns>
        public static SCObjectAndRelation GetRoot()
        {
            SCOrganization   root         = SCOrganization.GetRoot();
            SCRelationObject rootRelation = SCOrganization.GetRootRelationObject();

            SCObjectAndRelation result = new SCObjectAndRelation();

            result.ID          = root.ID;
            result.Name        = root.Name;
            result.CodeName    = root.CodeName;
            result.DisplayName = root.DisplayName;
            result.SchemaType  = root.SchemaType;
            result.Status      = root.Status;

            result.Default    = rootRelation.Default;
            result.InnerSort  = rootRelation.InnerSort;
            result.GlobalSort = rootRelation.GlobalSort;
            result.ParentID   = rootRelation.ParentID;
            result.FullPath   = rootRelation.FullPath;

            return(result);
        }
Ejemplo n.º 4
0
 protected override string GetKeyForItem(SCRelationObject item)
 {
     return(item.ParentID);
 }