diff --git a/Bootstrap.Admin/Web.config b/Bootstrap.Admin/Web.config
index 827502a9..487ac019 100644
--- a/Bootstrap.Admin/Web.config
+++ b/Bootstrap.Admin/Web.config
@@ -43,6 +43,7 @@
+
diff --git a/Bootstrap.DataAccess/DictHelper.cs b/Bootstrap.DataAccess/DictHelper.cs
index 068c800a..6f076f9f 100644
--- a/Bootstrap.DataAccess/DictHelper.cs
+++ b/Bootstrap.DataAccess/DictHelper.cs
@@ -15,6 +15,7 @@ namespace Bootstrap.DataAccess
internal const string RetrieveDictsDataKey = "DictHelper-RetrieveDicts";
internal const string RetrieveWebSettingsDataKey = "DictHelper-RetrieveDictsWebSettings";
internal const string RetrieveIconPathSettingsDataKey = "DictHelper-RetrieveDictsIconPathSettings";
+ internal const string RetrieveCategoryDataKey = "DictHelper-RetrieveDictsCategory";
///
/// 查询所有字典信息
///
@@ -218,5 +219,30 @@ namespace Bootstrap.DataAccess
return dict;
}, CacheSection.RetrieveDescByKey(RetrieveIconPathSettingsDataKey));
}
+ ///
+ /// 获取字典分类名称
+ ///
+ ///
+ public static IEnumerable
RetrieveCategories()
+ {
+ return CacheManager.GetOrAdd(RetrieveCategoryDataKey, CacheSection.RetrieveIntervalByKey(RetrieveCategoryDataKey), key =>
+ {
+ var ret = new List();
+ string sql = "select distinct Category from Dicts";
+ DbCommand cmd = DBAccessManager.SqlDBAccess.CreateCommand(CommandType.Text, sql);
+ try
+ {
+ using (DbDataReader reader = DBAccessManager.SqlDBAccess.ExecuteReader(cmd))
+ {
+ while (reader.Read())
+ {
+ ret.Add((string)reader[0]);
+ }
+ }
+ }
+ catch (Exception ex) { ExceptionManager.Publish(ex); }
+ return ret;
+ }, CacheSection.RetrieveDescByKey(RetrieveCategoryDataKey));
+ }
}
}