Example #1
0
 public void SetMaxUserMembershipCount(long?tenantId, int value)
 {
     if (tenantId.HasValue)
     {
         _settingManager.ChangeSettingForTenant(tenantId.Value, AbpZeroSettingNames.OrganizationUnits.MaxUserMembershipCount, value.ToString());
     }
     else
     {
         _settingManager.ChangeSettingForApplication(AbpZeroSettingNames.OrganizationUnits.MaxUserMembershipCount, value.ToString());
     }
 }
Example #2
0
        /// <summary>
        /// Changes setting for tenant with fallback to application
        /// </summary>
        /// <param name="name">Setting name</param>
        /// <param name="value">Setting value</param>
        public static void ChangeSetting(this ISettingManager manager, string name, string value)
        {
            var session = StaticContext.IocManager.Resolve <IAbpSession>();

            if (session.TenantId.HasValue)
            {
                manager.ChangeSettingForTenant(session.TenantId.Value, name, value);
            }
            else
            {
                manager.ChangeSettingForApplication(name, value);
            }
        }
Example #3
0
        /// <summary>
        /// Sets the default language for a tenant or the host.
        /// </summary>
        /// <param name="tenantId">Tenant Id of null for host</param>
        /// <param name="languageName">Name of the language.</param>
        public virtual void SetDefaultLanguage(long?tenantId, string languageName)
        {
            var cultureInfo = CultureInfo.GetCultureInfo(languageName);

            if (tenantId.HasValue)
            {
                _settingManager.ChangeSettingForTenant(tenantId.Value, LocalizationSettingNames.DefaultLanguage, cultureInfo.Name);
            }
            else
            {
                _settingManager.ChangeSettingForApplication(LocalizationSettingNames.DefaultLanguage, cultureInfo.Name);
            }
        }