Esempio n. 1
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            TempStoreSPSyncSettingsList(false);

            int id;

            if (int.TryParse(Request.QueryString["id"], out id))
            {
                spSyncSettings = spSyncSettingsList.Get(id);
                spConfig       = SPConfigurationService.Get(spSyncSettings.SPSiteURL, spSyncSettings.Authentication);
                if (spSyncSettings.SyncConfig != null)
                {
                    spConfig.FarmProfileMappedFields = spSyncSettings.SyncConfig.FarmProfileMappedFields;
                    spConfig.SiteProfileMappedFields = spSyncSettings.SyncConfig.SiteProfileMappedFields;
                    spConfig.SyncEnabled             = spSyncSettings.SyncConfig.SyncEnabled;
                    spConfig.FarmSyncEnabled         = spSyncSettings.SyncConfig.FarmSyncEnabled;
                }
            }
            else
            {
                ShowErrorMessage("Incorrect request. Please try again or contact your administrator.");
            }
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            TempStoreSPSyncSettingsList(false);
            Mode = Request.QueryString["mode"] == "add" ? PageMode.Add : PageMode.Edit;
            if (Mode == PageMode.Add)
            {
                spSyncSettings = new SPProfileSyncProvider(String.Empty, String.Empty, String.Empty, String.Empty, null);
                Header.Title   = AddPageTitleText;
                CtAuth.Controls.Add(AuthenticationHelper.GetPropertyControls(authBuilder));

                TbUserIdFieldName.Text        = "ID";
                TbUserEmailFieldName.Text     = "EMail";
                TbFarmUserEmailFieldName.Text = "WorkEmail";
            }
            else
            {
                Header.Title = EditPageTitleText;
                int id;
                if (int.TryParse(Request.QueryString["id"], out id))
                {
                    spSyncSettings = spSyncSettingsList.Get(id);
                    spConfig       = SPConfigurationService.Get(spSyncSettings.SPSiteURL, spSyncSettings.Authentication);
                    CtAuth.Controls.Add(AuthenticationHelper.SetPropertyControls(spSyncSettings.Authentication, authBuilder));
                    DisplaySyncSettings(spSyncSettings);
                }
            }

            TbFarmUserIdFieldName.Text = spSyncSettings.SPFarmUserIdFieldName;
        }