33 lines
837 B
C#
33 lines
837 B
C#
using System;
|
|
|
|
namespace WX.CRM.DataSynApi.Dao
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class StoreFactory
|
|
{
|
|
private static readonly string _dbType = WX.CRM.Common.Utility.GetSettingOrNullByKey("DatabaseType");
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public IStore GetStore()
|
|
{
|
|
if (string.IsNullOrEmpty(_dbType))
|
|
throw new Exception("数据库类型配置错误!");
|
|
IStore store = null;
|
|
switch (_dbType)
|
|
{
|
|
case "ORACLE":
|
|
store = new OracleStore();
|
|
break;
|
|
case "MYSQL":
|
|
store = new MySqlStore();
|
|
break;
|
|
}
|
|
return store;
|
|
}
|
|
}
|
|
} |