Beispiel #1
0
        /// <summary>
        /// Will overwrite the system settings stored in SystemData. As there's just one record and that record is already there, it's just overwriting the
        /// existing entity.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="newDefaultUserRoleNewUsers">The new default user role for new users.</param>
        /// <param name="newAnonymousRole">The new anonymous role.</param>
        /// <param name="newUserTitleNewUsers">The new user title for new users.</param>
        /// <param name="hoursThresholdForActiveThreads">The hours threshold for active threads.</param>
        /// <param name="pageSizeSearchResults">The page size search results.</param>
        /// <param name="minimalNumberOfThreadsToFetch">The minimal number of threads to fetch.</param>
        /// <param name="minimalNumberOfNonStickyVisibleThreads">The minimal number of non sticky visible threads.</param>
        /// <param name="sendReplyNotifications">The setting to send notification emails or not. If set to false the system won't send
        /// notification emails and users can't subscribe / unsubscribe to threads.</param>
        /// <returns>
        /// true if save was succeeded, false otherwise
        /// </returns>
        public static bool StoreNewSystemSettings(int id, int newDefaultUserRoleNewUsers, int newAnonymousRole, int newUserTitleNewUsers, 
            short hoursThresholdForActiveThreads, short pageSizeSearchResults, short minimalNumberOfThreadsToFetch,
            short minimalNumberOfNonStickyVisibleThreads, bool sendReplyNotifications)
        {
            // fetch the existing system data entity.
            SystemDataEntity systemData = new SystemDataEntity(id);

            // update its parameters.
            systemData.DefaultRoleNewUser = newDefaultUserRoleNewUsers;
            systemData.AnonymousRole = newAnonymousRole;
            systemData.DefaultUserTitleNewUser = newUserTitleNewUsers;
            systemData.HoursThresholdForActiveThreads = hoursThresholdForActiveThreads;
            systemData.PageSizeSearchResults = pageSizeSearchResults;
            systemData.MinNumberOfNonStickyVisibleThreads = minimalNumberOfNonStickyVisibleThreads;
            systemData.MinNumberOfThreadsToFetch = minimalNumberOfThreadsToFetch;
            systemData.SendReplyNotifications = sendReplyNotifications;
            return systemData.Save();
        }
Beispiel #2
0
        /// <summary>Creates a new, empty SystemDataEntity object.</summary>
        /// <returns>A new, empty SystemDataEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new SystemDataEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSystemData
            // __LLBLGENPRO_USER_CODE_REGION_END
            return toReturn;
        }