using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Core.LgMes.Client.lgDbMgt { /// /// 入口类,根据db类型返回调用2.5还是三期 /// 采用工厂方法模式获取db实例 /// 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; } /// /// 默认返回2.5级数据库 /// /// public static IDbCommand createDbCommand() { return new DbLgEjgzFactory().createDbCommand(); } } }