⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sitesettingsview.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
📖 第 1 页 / 共 3 页
字号:
            companyEmailAddress             = (TextBox) skin.FindControl("CompanyEmailAddress");
            companyName                     = (TextBox) skin.FindControl("CompanyName");
            #endregion

            #region Home Page Menus & Sections
            publicMemberList                = (RadioButtonList) skin.FindControl("PublicMemberList");
            publicWhoIsOnline               = (RadioButtonList) skin.FindControl("DisplayWhoIsOnline");
            publicTodaysBirthdays           = (RadioButtonList) skin.FindControl("DisplayBirthdays");
            publicCurrentTime               = (RadioButtonList) skin.FindControl("DisplayCurrentTime");
            publicForumDescription          = (RadioButtonList) skin.FindControl("DisplayForumDescription");
            publicSiteStatistics            = (YesNoRadioButtonList) skin.FindControl("DisplayStatistics");
            #endregion

            #region RSS
            enableRss                       = (RadioButtonList) skin.FindControl("EnableForumRSS");
            rssDefaultThreadsPerFeed        = (TextBox) skin.FindControl("RSSDefaultThreadsPerFeed");
            rssMaxThreadsPerFeed            = (TextBox) skin.FindControl("RSSMaxThreadsPerFeed");
            rssCacheWindowInMinutes         = (TextBox) skin.FindControl("RssCacheWindowInMinutes");
            #endregion

            #region User settings and Registration
            signatureMaxLength              = (TextBox) skin.FindControl("SignatureMaxLength");
            allowSignatures                 = (RadioButtonList) skin.FindControl("AllowSignatures");
            enableSignatures                = (RadioButtonList) skin.FindControl("EnableSignatures");
            accountActivationOption         = (RadioButtonList) skin.FindControl("AccountActivation");
            passwordRecovery                = (RadioButtonList) skin.FindControl("PasswordRecovery");
            passwordFormat                  = (DropDownList) skin.FindControl("PasswordFormat");
            enableUsernameChange            = (RadioButtonList) skin.FindControl("EnableUsernameChange");            
            allowNewUserRegistration        = (RadioButtonList) skin.FindControl("AllowNewUserRegistration");            
            allowLogin                      = (RadioButtonList) skin.FindControl("AllowLogin");            
            newUserModerationLevel          = (ModerationLevelDropDownList) skin.FindControl("NewUserModerationLevel");            
            allowGender                     = (RadioButtonList) skin.FindControl("AllowGender");            
            #endregion

            #region Date & Times
            dateFormat                      = (DateFormatDropDownList) skin.FindControl("DateFormat");
            timeFormat                      = (TextBox) skin.FindControl("TimeFormat");
            timeZone                        = (TimezoneDropDownList) skin.FindControl("Timezone");
            #endregion

            #region User Posting
            allowDuplicatePosts             = (RadioButtonList) skin.FindControl("AllowDuplicatePosts");
            duplicatePostIntervalInMinutes  = (TextBox) skin.FindControl("DuplicatePostIntervalInMinutes");
            postInterval                    = (TextBox) skin.FindControl("PostInterval");
            #endregion

            #region IP Address Tracking
            trackPostsByIP                      = (RadioButtonList) skin.FindControl("EnableTrackPostsByIP");
            displayPostIP                       = (RadioButtonList) skin.FindControl("DisplayPostIP");
            displayPostIPAdminsModeratorsOnly   = (RadioButtonList) skin.FindControl("DisplayPostIPAdminsModeratorsOnly");
            #endregion

            #region Member list and Top Posters
            topPostMaxMembersToDisplay          = (TextBox) skin.FindControl("MemberListTopPostersToDisplay");
            membersPerPage                      = (TextBox) skin.FindControl("MemberListPageSize");
            enablePublicAdvancedMemberSearch    = (YesNoRadioButtonList) skin.FindControl("MemberListAdvancedSearch");
            #endregion

            #region Posts
            popularPostThresholdPosts       = (TextBox) skin.FindControl("PopularPostThresholdPosts");
            popularPostThresholdViews       = (TextBox) skin.FindControl("PopularPostThresholdViews");
            popularPostThresholdDays        = (TextBox) skin.FindControl("PopularPostThresholdDays");
            #endregion

            #region Post Editing
            enableDisplayEditNotes          = (YesNoRadioButtonList) skin.FindControl("DisplayEditNotes");
            editPostBodyAge                 = (TextBox) skin.FindControl("PostEditBodyAgeInMinutes");
            editPostTitleAge                = (TextBox) skin.FindControl("PostEditTitleAgeInMinutes");
            #endregion

            #region Forum URLs
            enableSearchFriendlyURLs        = (RadioButtonList ) skin.FindControl("EnableSearchFriendlyURLs");
            #endregion


            // DropDownLists & RadioButtonLists
            //
            autoPostDelete                  = (RadioButtonList) skin.FindControl("AutoPostDelete");
            autoUserDelete                  = (RadioButtonList) skin.FindControl("AutoUserDelete");
            anonymousPosting                = (RadioButtonList) skin.FindControl("AnonymousPosting");
            enableEmoticons                 = (RadioButtonList) skin.FindControl("EnableEmoticons");
            enableAvatars                   = (RadioButtonList) skin.FindControl("EnableAvatars");
            enableRemoteAvatars             = (RadioButtonList) skin.FindControl("EnableRemoteAvatars");
            enableRolesCookie               = (RadioButtonList) skin.FindControl("EnableRolesCookie");
            enableAnonymousTracking         = (RadioButtonList) skin.FindControl("EnableAnonymousTracking");
            enableEmail                     = (RadioButtonList) skin.FindControl("EnableEmail");

            // Buttons
            //
            save                            = (Button) skin.FindControl("Save");
            reset                           = (Button) skin.FindControl("Reset");

            save.Attributes["onclick"] = "return confirm('" + string.Format(AspNetForums.Components.ResourceManager.GetString("Cache_Warning"), Globals.GetSiteSettings().SiteSettingsCacheWindowInMinutes) + "');";								

            // Wire-up buttons
            //
            save.Click += new EventHandler(Save_Click);
            reset.Click += new EventHandler(Reset_Click);

            if (!Page.IsPostBack)
                DataBind();

        }
        #endregion

        #region Reset Event
        public void Reset_Click (Object sender, EventArgs e) {
            settings = new SiteSettings();
            settings.SiteDomain = domain.SelectedDomain;

            settings.Save();

            DataBind();
        }
        #endregion

        #region Save Event
        public void Save_Click (Object sender, EventArgs e) {

            settings = SiteSettings.GetSiteSettings(domain.SelectedDomain);
            settings.SiteDomain = domain.SelectedDomain;

            switch (viewMode) {

                case SiteSettingsMode.MemberSettings:
                    #region User Registration
                    settings.AllowUserSignatures            = Boolean.Parse( allowSignatures.SelectedItem.Value);
                    settings.EnableUserSignatures           = Boolean.Parse( enableSignatures.SelectedItem.Value);
                    settings.UserSignatureMaxLength         = int.Parse( signatureMaxLength.Text);
                    settings.AccountActivation              = (AccountActivation) Enum.Parse( typeof(AccountActivation), accountActivationOption.SelectedItem.Value);
                    settings.PasswordRecovery               = (PasswordRecovery) Enum.Parse( typeof(PasswordRecovery), passwordRecovery.SelectedItem.Value);
                    settings.PasswordFormat                 = (UserPasswordFormat) Enum.Parse( typeof(UserPasswordFormat), passwordFormat.SelectedItem.Value);
                    settings.EnableUsernameChange           = Boolean.Parse( enableUsernameChange.SelectedItem.Value);
                    settings.AllowNewUserRegistration       = Boolean.Parse( allowNewUserRegistration.SelectedItem.Value);
                    settings.AllowLogin                     = Boolean.Parse( allowLogin.SelectedItem.Value);
                    settings.NewUserModerationLevel         = newUserModerationLevel.SelectedValue;
                    settings.AllowGender                    = Boolean.Parse( allowGender.SelectedItem.Value);
                    #endregion

                    #region User Avatars
                    settings.EnableAvatars                  = Boolean.Parse( enableAvatars.SelectedItem.Value);
                    settings.EnableRemoteAvatars            = Boolean.Parse( enableRemoteAvatars.SelectedItem.Value);
                    settings.AvatarHeight                   = int.Parse( avatarHeight.Text);
                    settings.AvatarWidth                    = int.Parse( avatarWidth.Text);
                    #endregion

                    break;

                default:
                    // Tab 1
                    settings.SiteName                       = siteName.Text;
                    settings.SiteDescription                = siteDescription.Text;
                    settings.ThreadsPerPage                 = Convert.ToInt32( threadsPerPage.Text );
                    settings.PostsPerPage                   = Convert.ToInt32( postsPerPage.Text );

                    #region Forums Disabled
                    settings.ForumsDisabled                 = Boolean.Parse( disabled.SelectedItem.Value );
                    #endregion

                    #region Contact Us
                    settings.AdminEmailAddress              = adminEmailAddress.Text;
                    settings.CompanyName                    = companyName.Text;
                    settings.CompanyAddress                 = companyAddress.Text;
                    settings.CompanyContactUs               = companyEmailAddress.Text;
                    settings.CompanyFaxNumber               = companyFaxNumber.Text;
                    #endregion

                    #region Home Page Menus & Sections
                    settings.EnablePublicMemberList     = Boolean.Parse( publicMemberList.SelectedItem.Value );
                    settings.EnableWhoIsOnline          = Boolean.Parse( publicWhoIsOnline.SelectedItem.Value);
                    settings.EnableBirthdays            = Boolean.Parse( publicTodaysBirthdays.SelectedItem.Value);
                    settings.EnableCurrentTime          = Boolean.Parse( publicCurrentTime.SelectedItem.Value);
                    settings.EnableForumDescription     = Boolean.Parse( publicForumDescription.SelectedItem.Value);
                    settings.EnableSiteStatistics       = publicSiteStatistics.SelectedValue;
                    #endregion

                    #region RSS
                    settings.EnableRSS                  = Boolean.Parse( enableRss.SelectedItem.Value );
                    settings.RssCacheWindowInMinutes    = int.Parse(rssCacheWindowInMinutes.Text);
                    settings.RssDefaultThreadsPerFeed   = int.Parse(rssDefaultThreadsPerFeed.Text);
                    settings.RssMaxThreadsPerFeed       = int.Parse(rssMaxThreadsPerFeed.Text);
                    #endregion

                    #region User Posting
                    settings.EnableDuplicatePosts           = Boolean.Parse( allowDuplicatePosts.SelectedItem.Value );
                    settings.DuplicatePostIntervalInMinutes = int.Parse(duplicatePostIntervalInMinutes.Text);
                    settings.PostInterval                   = Convert.ToInt32( postInterval.Text );
                    #endregion

                    #region IP Address Tracking
                    settings.EnableTrackPostsByIP               = Boolean.Parse( trackPostsByIP.SelectedItem.Value );
                    settings.DisplayPostIP                      = Boolean.Parse( displayPostIP.SelectedItem.Value);
                    settings.DisplayPostIPAdminsModeratorsOnly  = Boolean.Parse( displayPostIPAdminsModeratorsOnly.SelectedItem.Value);
                    #endregion

                    #region Date & Times
                    settings.TimezoneOffset                 = Convert.ToInt32( timeZone.SelectedItem.Value );
                    settings.TimeFormat                     = timeFormat.Text;
                    settings.DateFormat                     = dateFormat.SelectedItem.Value;
                    #endregion

                    #region Posts
                    settings.PopularPostLevelPosts          = Convert.ToInt32( popularPostThresholdPosts.Text );
                    settings.PopularPostLevelViews          = Convert.ToInt32( popularPostThresholdViews.Text );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -