From 24851b366aa44591cb47f02e5e6752c6e583bd7c Mon Sep 17 00:00:00 2001 From: Martin Ingvar Kofoed Jensen Date: Wed, 7 Dec 2011 14:21:08 +0100 Subject: [PATCH] --- .../Foundation/DynamicTypesCommon.cs | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Composite/Plugins/Data/DataProviders/MSSqlServerDataProvider/Foundation/DynamicTypesCommon.cs b/Composite/Plugins/Data/DataProviders/MSSqlServerDataProvider/Foundation/DynamicTypesCommon.cs index 1514fd7894..b8d4cb7452 100644 --- a/Composite/Plugins/Data/DataProviders/MSSqlServerDataProvider/Foundation/DynamicTypesCommon.cs +++ b/Composite/Plugins/Data/DataProviders/MSSqlServerDataProvider/Foundation/DynamicTypesCommon.cs @@ -33,13 +33,31 @@ internal static string GenerateTableName(DataTypeDescriptor dataTypeDescriptor, throw new InvalidOperationException("Unsupported data scope identifier: '{0}'".FormatWith(dataScope.Name)); } - string result = string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, publicationScope); + string storageKey = GetStorageName(publicationScope.ToString(), cultureInfo.Name); - if (!string.IsNullOrEmpty(cultureInfo.ToString())) result += "_" + cultureInfo.ToString().Replace("-", ""); + return string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, storageKey); - return result; +#warning MRJ: BM: Clean this + //string result = string.Format("{0}_{1}_{2}", tableNameStem, dataTypeDescriptor.Name, publicationScope); + + //if (!string.IsNullOrEmpty(cultureInfo.ToString())) result += "_" + cultureInfo; + + //return result; } + + internal static string GetStorageName(string dataScope, string cultureName) + { + string result = dataScope; + if (!cultureName.IsNullOrEmpty()) + { + result += "_" + cultureName.Replace('-', '_').Replace(' ', '_'); + } + return result; + } + + + internal static string GenerateListTableName(DataTypeDescriptor typeDescriptor, DataFieldDescriptor fieldDescriptor) { return string.Format("{0}_{1}", GenerateTableName(typeDescriptor), fieldDescriptor.Name);