32 lines
812 B
C#
32 lines
812 B
C#
using System;
|
|
using System.Configuration;
|
|
|
|
namespace WX.CRM.DataSynClient.Dao
|
|
{
|
|
public class StoreFactory
|
|
{
|
|
private static readonly string _dbType = ConfigurationManager.AppSettings["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;
|
|
}
|
|
}
|
|
}
|