예제 #1
0
 public static void AddDBServiceByServiceID(string serviceID,DBService db)
 {
     if (!DBService_Dict.ContainsKey(serviceID))
     {
         DBService_Dict.Add(serviceID, db);
     }
 }
예제 #2
0
 public void AddDbService(string serviceName, DBService DB)
 {
     if (!_Dir_DBService.ContainsKey(serviceName))
     {
         _Dir_DBService.Add(serviceName, DB);
     }
 }
예제 #3
0
 public static DataOperation GetDataOperation(string tablename, DBService db, bool IsLoadDt, FieldCollection fields)
 {
     if(db == null)
         db = DBServiceFactory.GetDBService();
     switch (db.DBType)
     {
         case eDBType.SqlServer:
             return null;
         case eDBType.Oracle:
             return new DataOperationOracle(tablename,db,IsLoadDt,fields);
         case eDBType.XML:
             return new DataOperation_XML(tablename, db, IsLoadDt, fields);
         default:
             return new DataOperationOracle(tablename, db, IsLoadDt, fields);
     }
 }
예제 #4
0
 /// <summary>
 /// 自动读数据库载入数据的构造函数
 /// </summary>
 /// <param name="tablename">表名</param>
 /// <param name="db">操作数据类</param>
 /// <param name="IsLoadDt">是否从数据库载入数据到类中</param>
 /// <param name="fields">Field集合</param>        
 public DataOperation(string tablename, DBService db, bool IsLoadDt, FieldCollection fields)
 {
     this.TableName = tablename;
     if(db == null)
         throw WAPExceptionHelper.GetWAPException(10001052, "A DBService must be inputted into the constructer", null);
     else
         this.theDB = db;
     if (fields == null || fields.Count == 0)
         throw WAPExceptionHelper.GetWAPException(10001051, "A FieldCollection must be inputted into the constructer", null);
     else
         this.Fields = fields;
     if (IsLoadDt)
     {
         this.InitData();
     }
     this.WhereFields = new FieldCollection();
 }
예제 #5
0
 public UserManger()
 {
     theDB = DBServiceFactory.GetDBService("MeasurerXML");
 }
예제 #6
0
 public static DataOperation GetDataOperation(string tabNameID, DBService dbserver, bool isload, FieldCollection fields)
 {
     DataOperation op = DBServiceFactory.GetDataOperation(tabNameID, dbserver, isload, fields);
     return op;
 }
예제 #7
0
 public MeasurerProcess()
 {
     CurrentTask = new Task();
     theDB = DBServiceFactory.GetDBService("MeasurerXML");
 }
예제 #8
0
 public DataOperation_XML(string tablename, DBService db, bool IsLoadDt, FieldCollection fields)
     : base(tablename, db, IsLoadDt, fields)
 {
 }