init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Zhaizj.Framework.Config.DotNetConfig;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Zhaizj.Framework.Data.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库配置方式
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 配置文件格式和说明:
|
||||
/// <code>
|
||||
/// <configSections>
|
||||
/// <sectionGroup name="Zhaizj.Config" type="Zhaizj.Framework.Config.GroupHandler,Zhaizj.Framework">;
|
||||
/// <section name="DataBase" type="Zhaizj.Framework.Data.Config.SectionHandler, Zhaizj.Framework"/>;
|
||||
/// </sectionGroup>
|
||||
/// </configSections>
|
||||
/// <Zhaizj.Config>
|
||||
/// <log>
|
||||
/// <log/>
|
||||
/// <Zhaizj.Config/>
|
||||
/// ......
|
||||
/// </code>
|
||||
/// </remarks>
|
||||
public class SectionDataHandler : SectionBaseHandler<SectionDataHandler>
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置数据库连接
|
||||
/// </summary>
|
||||
[ConfigurationProperty("ConnectionStringTable", DefaultValue = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=zhaizj.mdb")]
|
||||
public string ConnectionStringTable
|
||||
{
|
||||
get { return (string)this["ConnectionStringTable"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置数据库类型
|
||||
/// </summary>
|
||||
[ConfigurationProperty("DbType", DefaultValue = "access")]
|
||||
public string DbType
|
||||
{
|
||||
get { return (string)this["DbType"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置多数据库
|
||||
/// </summary>
|
||||
[ConfigurationProperty("Mapping", DefaultValue = "")]
|
||||
public string Mapping
|
||||
{
|
||||
get { return (string)this["Mapping"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///是否启用缓存
|
||||
/// </summary>
|
||||
[ConfigurationProperty("ApplicationCache", DefaultValue = "false")]
|
||||
public string ApplicationCache
|
||||
{
|
||||
get { return (string)this["ApplicationCache"]; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///设置缓存时间-999 是永久缓存
|
||||
/// </summary>
|
||||
[ConfigurationProperty("ApplicationCacheMinutes", DefaultValue = "-999")]
|
||||
public string ApplicationCacheMinutes
|
||||
{
|
||||
get { return (string)this["ApplicationCacheMinutes"]; }
|
||||
}
|
||||
/// <summary>
|
||||
///缓存管理
|
||||
/// </summary>
|
||||
[ConfigurationProperty("ApplicationCacheManager", DefaultValue = "")]
|
||||
public string ApplicationCacheManager
|
||||
{
|
||||
get { return (string)this["ApplicationCacheManager"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
//程序集初始化
|
||||
/// </summary>
|
||||
[ConfigurationProperty("AssemblyList", DefaultValue = "Zhaizj.CoreApps")]
|
||||
public string AssemblyList
|
||||
{
|
||||
get { return (string)this["AssemblyList"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拦截器
|
||||
/// </summary>
|
||||
[ConfigurationProperty("Interceptor", DefaultValue = "Zhaizj.CoreApps")]
|
||||
public string Interceptor
|
||||
{
|
||||
get { return (string)this["Interceptor"]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拼接代码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetDataConfig()
|
||||
{
|
||||
StringBuilder tagData = new StringBuilder();
|
||||
tagData.Append("{");
|
||||
tagData.Append("ConnectionStringTable : {default:\"" + ConnectionStringTable + "\"},");
|
||||
tagData.Append("DbType : { default:\"" + DbType + "\"},");
|
||||
tagData.Append("Mapping:[" + Mapping + "],");
|
||||
tagData.Append("ApplicationCache:" + ApplicationCache + ",");
|
||||
tagData.Append("ApplicationCacheMinutes:" + ApplicationCacheMinutes + ",");
|
||||
tagData.Append("ApplicationCacheManager:\"" + ApplicationCacheManager + "\",");
|
||||
tagData.Append("AssemblyList : [\"" + AssemblyList + "\"], Interceptor:[]");
|
||||
tagData.Append("}");
|
||||
return tagData.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user