public static void CreateArchiveTableIfNotExists(SiteInfo siteInfo, string tableName) { if (!DataProvider.DatabaseDao.IsTableExists(TableMetadataManager.GetTableNameOfArchive(tableName))) { try { DataProvider.TableDao.CreateDbTableOfArchive(tableName); } catch { // ignored } } }
public static List <TableStyleInfo> GetTableStyleInfoList(string tableName, List <int> relatedIdentities) { var allAttributeNames = new List <string>(); var styleInfoList = new List <TableStyleInfo>(); var entries = GetAllTableStyleInfoPairs(); relatedIdentities = GetRelatedIdentities(relatedIdentities); foreach (var relatedIdentity in relatedIdentities) { var startKey = GetCacheKeyStart(relatedIdentity, tableName); var keyList = entries.GetKeys(startKey); foreach (var key in keyList) { var styleInfo = entries.GetValue(key) as TableStyleInfo; if (styleInfo == null) { continue; } if (!allAttributeNames.Contains(styleInfo.AttributeName.ToLower())) { allAttributeNames.Add(styleInfo.AttributeName.ToLower()); styleInfoList.Add(styleInfo); } } } var attributeNames = TableMetadataManager.GetAttributeNameList(tableName); foreach (var attributeName in attributeNames) { if (!allAttributeNames.Contains(attributeName.ToLower())) { allAttributeNames.Add(attributeName.ToLower()); styleInfoList.Add(GetDefaultTableStyleInfo(tableName, attributeName)); } } styleInfoList.Sort(); return(styleInfoList); }