| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Core.LgMes.Client.lgDbMgt
- {
- /// <summary>
- /// 入口类,根据db类型返回调用2.5还是三期
- /// 采用工厂方法模式获取db实例
- /// </summary>
- public class DbCommandFactory
- {
- public static IDbCommand createDbCommand(DbCommandType type)
- {
- IDbCommand commond = null;
- switch (type)
- {
- case DbCommandType.Ejgz:
- commond = new DbLgEjgzFactory().createDbCommand();
- break;
- case DbCommandType.TqMes:
- commond = new DbLg3qMesFactory().createDbCommand();
- break;
- default:
- commond = new DbLgEjgzFactory().createDbCommand();
- break;
- }
- return commond;
- }
- /// <summary>
- /// 默认返回2.5级数据库
- /// </summary>
- /// <returns></returns>
- public static IDbCommand createDbCommand()
- {
- return new DbLgEjgzFactory().createDbCommand();
- }
- }
- }
|