private void SaveSettings()
        {
            ModuleController ctlModule = new ModuleController();
            var sec = new Security.PortalSecurity();
            ctlModule.DeleteModuleSettings(this.ModuleId);
            ctlModule.DeleteTabModuleSettings(this.TabModuleId);

            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusApplicationName", sec.InputFilter(txtAppName.Text, PortalSecurity.FilterFlag.NoMarkup), true, PortalSettings.CultureCode);
            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusApiSecret", sec.InputFilter(txtApiSecret.Text, PortalSecurity.FilterFlag.NoMarkup), true, PortalSettings.CultureCode);
            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusRequireDnnLogin", chkRequireDnnLogin.Checked.ToString(), true, PortalSettings.CultureCode);
            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusDeveloperMode", chkDeveloperMode.Checked.ToString(), true, PortalSettings.CultureCode);
            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusSsoEnabled", chkSsoEnabled.Checked.ToString(), true);
            Entities.Portals.PortalController.UpdatePortalSetting(PortalId, "wnsDisqusSsoApiKey", sec.InputFilter(txtSsoApiKey.Text, PortalSecurity.FilterFlag.NoMarkup), true);

            if (UserInfo.IsSuperUser)
            {
                // save & apply schedule preferences
                ManageSchedulerItem();
            }

            ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DisqusView", this.cboModuleView.SelectedValue);

            switch (this.cboModuleView.SelectedValue)
            {
                case "comments":
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "AttachedModuleId", this.cboModuleList.SelectedValue);
                    break;
                case "combination":
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DisplayItems", this.cboDisplayItems.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "ShowModerators", this.chkShowModerators.Checked.ToString());
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "ColorTheme", this.cboColorTheme.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DefaultTab", this.cboDefaultTab.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "CommentLength", sec.InputFilter(this.txtCommentLength.Text, PortalSecurity.FilterFlag.NoMarkup));
                    break;
                case "recent-comments":
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DisplayItems", this.cboDisplayItems.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "ShowAvatar", this.chkShowAvatar.Checked.ToString());
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "AvatarSize", this.cboAvatarSize.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "CommentLength", sec.InputFilter(this.txtCommentLength.Text, PortalSecurity.FilterFlag.NoMarkup));
                    break;
                case "popular-threads":
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DisplayItems", this.cboDisplayItems.SelectedValue);
                    break;
                case "top-commenters":
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "DisplayItems", this.cboDisplayItems.SelectedValue);
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "ShowModerators", this.chkShowModerators.Checked.ToString());
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "ShowAvatar", this.chkShowAvatar.Checked.ToString());
                    ctlModule.UpdateTabModuleSetting(this.TabModuleId, "AvatarSize", this.cboAvatarSize.SelectedValue);
                    break;
            }

            ModuleController.SynchronizeModule(this.ModuleId);
        }