public static ADToDBConfigSettings GetConfig()
		{
			ADToDBConfigSettings settings = (ADToDBConfigSettings)ConfigurationBroker.GetSection("adToDBConfigSettings");

			if (settings == null)
				settings = new ADToDBConfigSettings();

			return settings;
		}
Пример #2
0
        public static ADToDBConfigSettings GetConfig()
        {
            ADToDBConfigSettings settings = (ADToDBConfigSettings)ConfigurationBroker.GetSection("adToDBConfigSettings");

            if (settings == null)
            {
                settings = new ADToDBConfigSettings();
            }

            return(settings);
        }
Пример #3
0
        public static AD2DBInitialParams GetParams()
        {
            AD2DBInitialParams result = new AD2DBInitialParams();

            ExceptionHelper.FalseThrow(ServerInfoConfigSettings.GetConfig().ServerInfos.ContainsKey("dc"),
                                       "不能在配制节serverInfoConfigSettings中找到名称为dc的配置项");

            result.serverInfo     = ServerInfoConfigSettings.GetConfig().ServerInfos["dc"].ToServerInfo();
            result.adHelper       = ADHelper.GetInstance(result.serverInfo);
            result.userInfoExtend = ADToDBConfigSettings.GetConfig().UserInfoExtendConnectionName;

            return(result);
        }
        public void InitContext()
        {
            using (DbContext context = DbContext.GetContext(this.initialParams.AccreditAdminConnectionName))
            {
                FillData(this.OriginalData, "SELECT * FROM USERS", "USERS", context);
                FillData(this.OriginalData, "SELECT * FROM OU_USERS ORDER BY ALL_PATH_NAME", "OU_USERS", context);
                FillData(this.OriginalData, "SELECT * FROM ORGANIZATIONS ORDER BY ALL_PATH_NAME", "ORGANIZATIONS", context);
            }

            using (DbContext context = DbContext.GetContext(this.initialParams.UserInfoExtend))
            {
                FillData(this.OriginalData, "SELECT * FROM USERS_INFO_EXTEND", "USERS_INFO_EXTEND", context);
            }

            CloneDataSetSchema(OriginalData, ADData);

            InitRootOURow(
                OriginalData.Tables["ORGANIZATIONS"],
                ADData.Tables["ORGANIZATIONS"],
                ADToDBConfigSettings.GetConfig().RootOUName);

            DataRow newRow = InitRootOURow(
                OriginalData.Tables["ORGANIZATIONS"],
                ADData.Tables["ORGANIZATIONS"],
                AD2DBHelper.TranslateDNToFullPath(this.initialParams.Root.Properties["distinguishedName"].Value.ToString()));

            if (newRow != null)
            {
                newRow["CHILDREN_COUNTER"] = 0;
            }

            ADOguAllPathView      = new DataView(ADData.Tables["ORGANIZATIONS"]);
            ADOguAllPathView.Sort = "ALL_PATH_NAME";

            ADOguGuidView      = new DataView(ADData.Tables["ORGANIZATIONS"]);
            ADOguGuidView.Sort = "GUID";

            OriginalOguGuidView      = new DataView(OriginalData.Tables["ORGANIZATIONS"]);
            OriginalOguGuidView.Sort = "GUID";

            OriginalOguParentGuidView      = new DataView(OriginalData.Tables["ORGANIZATIONS"]);
            OriginalOguParentGuidView.Sort = "PARENT_GUID";

            OriginalOuUserParentGuidView      = new DataView(OriginalData.Tables["OU_USERS"]);
            OriginalOuUserParentGuidView.Sort = "PARENT_GUID";

            ADUsersGuidView      = new DataView(ADData.Tables["USERS"]);
            ADUsersGuidView.Sort = "GUID";

            UsersGuidView      = new DataView(OriginalData.Tables["USERS"]);
            UsersGuidView.Sort = "GUID";

            ADOuUserParentGuidView      = new DataView(ADData.Tables["OU_USERS"]);
            ADOuUserParentGuidView.Sort = "USER_GUID,PARENT_GUID";

            ADUserExtendGuidView      = new DataView(ADData.Tables["USERS_INFO_EXTEND"]);
            ADUserExtendGuidView.Sort = "ID";

            OriginalUserExtendGuidView      = new DataView(OriginalData.Tables["USERS_INFO_EXTEND"]);
            OriginalUserExtendGuidView.Sort = "ID";

            OriginalOUUserParentUserGuidView      = new DataView(OriginalData.Tables["OU_USERS"]);
            OriginalOUUserParentUserGuidView.Sort = "USER_GUID,PARENT_GUID";

            OriginalOUUserUserGuidView      = new DataView(OriginalData.Tables["OU_USERS"]);
            OriginalOUUserUserGuidView.Sort = "USER_GUID";
        }