Esempio n. 1
0
        /// <summary>
        /// 得到变化的角色
        /// </summary>
        /// <param name="app"></param>
        /// <param name="rolesNeedToImported"></param>
        /// <returns></returns>
        public static DeltaSchemaObjectCollection GetDeltaRoles(this SCApplication app, IEnumerable <SCRole> rolesNeedToImported)
        {
            ProcessProgress.Current.Response("获取需要变化的角色");

            SchemaObjectCollection roles = app.GetExistsImportedRoles();

            return(GetDeltaObjects(app.GetExistsImportedRoles(), rolesNeedToImported));
        }
Esempio n. 2
0
        private static List <SCRoleAndDeltaGroup> GetDeltaGroupsInRoles(this SCApplication app)
        {
            List <SCRoleAndDeltaGroup> result = new List <SCRoleAndDeltaGroup>();
            SchemaObjectCollection     roles  = app.GetExistsImportedRoles();

            ProcessProgress.Current.MaxStep += roles.Count;

            foreach (SCRole role in roles)
            {
                ProcessProgress.Current.Response(string.Format("获取需要变化的角色\"{0}\"中的群组", role.CodeName));

                SchemaObjectCollection groupsInOrgs = SchemaObjectAdapter.Instance.LoadByName("Groups", role.CodeName, SchemaObjectStatus.Normal, DateTime.MinValue);

                SCRoleAndDeltaGroup roleAndDelta = role.GetDeltaGroupsInRole(groupsInOrgs.FilterByType <SCGroup>());
                result.Add(roleAndDelta);

                ProcessProgress.Current.Increment();
                ProcessProgress.Current.Response(string.Format("获取需要变化的角色\"{0}\"中的群组完成", role.CodeName));
            }

            return(result);
        }