示例#1
0
        public static object InsertReturnIdentity(object obj, IDbTransaction trans)
        {
            Type        objType  = obj.GetType();
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.InsertReturnIdentity(obj, trans));
        }
示例#2
0
        public static void InsertBatch(ArrayList objs, IDbTransaction trans)
        {
            Type        objType  = objs[0].GetType();
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            accesser.InsertBatch(objs, trans);
        }
示例#3
0
        public object InsertReturnIdentity(object obj, IDbTransaction trans)
        {
            Type        objType  = obj.GetType();
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.InsertReturnIdentity(obj, trans));
        }
示例#4
0
        public object GetAObjectEspecial(Type objType, string theID)
        {
            string      whereStr = string.Format("Where ID = '{0}'", theID);
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetAObject(whereStr));
        }
示例#5
0
        public void InsertBatch(ArrayList objs, IDbTransaction trans)
        {
            Type        objType  = objs[0].GetType();
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            accesser.InsertBatch(objs, trans);
        }
示例#6
0
        public static void Update(object obj, IDbTransaction trans)
        {
            Type        objType  = obj.GetType();
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            accesser.Update(obj, trans);
        }
示例#7
0
        public void Update(object obj, IDbTransaction trans)
        {
            Type        objType  = obj.GetType();
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            accesser.Update(obj, trans);
        }
示例#8
0
        public void Initialize(IDBAccesser accesser, int page_Size, string whereStr, string[] fields)
        {
            this.theParas          = new DataPaginationParas(accesser.ConnectString, accesser.DbTableName, whereStr);
            this.theParas.Fields   = fields;
            this.theParas.PageSize = page_Size;

            this.fieldStrs = this.theParas.GetFiedString();
            this.adoBase   = new SqlADOBase(this.theParas.ConnectString);
        }
示例#9
0
        public DataPaginationManager(IDBAccesser accesser, string selectStr, int page_size, bool ascending)
        {
            this.curParas = new PaginationParas();
            this.curParas.ComplexIDName = "ID";
            this.curParas.PageSize      = page_size;
            this.curParas.SelectString  = this.CheckSelectString(selectStr);
            this.curParas.ConnectString = accesser.ConnectString;
            this.curParas.DbType        = accesser.DataBaseType;
            this.curParas.DBTableName   = accesser.DbTableName;
            this.curParas.Ascending     = ascending;

            this.InitializeAdoBase(accesser.DataBaseType, accesser.ConnectString);
            this.pageCount = this.GetPageCount();
        }
        private void LoadOneOptoticData(AptoticDataInformation info)
        {
            if (this.htableData[info.DataClassType] != null)
            {
                return;
            }

            IDBAccesser accesser = this.dbAccesserFactory.CreateDBAccesser(this.curDbType, info.ConnStr, info.DataClassType, null);

            if (accesser == null)
            {
                return;
            }

            object[] objs = accesser.GetObjects("");
            if (objs != null)
            {
                this.htableData.Add(info.DataClassType, objs);
            }
        }
        private IDBAccesser CreateDBAccesser(string dealerTypeName, string connStr, Type dataClassType, string assemblyName)
        {
            if (this.accesserCached)
            {
                if (this.htableCached[dataClassType] != null)
                {
                    return((IDBAccesser)this.htableCached[dataClassType]);
                }
            }

            Type tarType = AdvancedFunction.GetType(dealerTypeName, assemblyName);

            if (tarType == null)
            {
                throw new Exception("The target type is not exit !");
            }

            Type supType = typeof(DataAccess.IDBAccesser);

            // 不可用IsSubclassOf,IsSubclassOf 检测不了接口类型。
            if (!supType.IsAssignableFrom(tarType))
            {
                throw new Exception("The target DbDealer Type is not subclass of IDBAccesser !");
            }

            object[]    args     = { connStr };
            IDBAccesser accesser = (IDBAccesser)Activator.CreateInstance(tarType, args);

            if (this.accesserCached)
            {
                if (accesser != null)
                {
                    this.htableCached.Add(dataClassType, accesser);
                }
            }

            return(accesser);
        }
示例#12
0
        public static void Insert(Type objType, object obj, IDbTransaction trans)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            accesser.Insert(obj, trans);
        }
示例#13
0
        public static object GetAObject(Type objType, string whereStr)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetAObject(whereStr));
        }
示例#14
0
        public static object[] GetObjectsWithoutBolb(Type objType, string whereStr)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetObjectsWithoutBlob(whereStr));
        }
示例#15
0
        public static DataSet GetDataSet(Type objType, string select_str)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetDataSet(select_str));
        }
示例#16
0
        public bool FillBlobData(Type objType, object obj)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.FillBlobData(obj));
        }
示例#17
0
        public static bool FillBlobData(Type objType, object obj)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.FillBlobData(obj));
        }
示例#18
0
        public DataSet GetDataSet(Type objType, string select_str)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetDataSet(select_str));
        }
示例#19
0
        public object GetFieldValue(Type objType, string theID, string fieldName)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetFieldValue(theID, fieldName));
        }
示例#20
0
        public bool UpdateFieldValue(Type objType, object theID, string fieldName, object newVal, IDbTransaction trans)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.UpdateFieldValue(theID, fieldName, newVal, trans));
        }
示例#21
0
        public void Delete(Type objType, object ID, IDbTransaction trans)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            accesser.Delete(ID, trans);
        }
示例#22
0
        public static bool UpdateFieldValue(Type objType, object theID, string fieldName, object newVal, IDbTransaction trans)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.UpdateFieldValue(theID, fieldName, newVal, trans));
        }
示例#23
0
        public object GetFieldValueEx(Type objType, string whereStr, string fieldName)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetFieldValueEx(whereStr, fieldName));
        }
示例#24
0
        public static void Delete(Type objType, object ID, IDbTransaction trans)          //ID一般为int或string类型
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            accesser.Delete(ID, trans);
        }
示例#25
0
        public object GetAObject(Type objType, string whereStr)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetAObject(whereStr));
        }
示例#26
0
        public static IPaginationManager GetPaginationMgr(Type objType, int page_size, string whereStr, string[] columns)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetPaginationMgr(page_size, whereStr, columns));
        }
示例#27
0
        public object[] GetObjectsWithoutBolb(Type objType, string whereStr)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetObjectsWithoutBlob(whereStr));
        }
示例#28
0
        public static object GetFieldValue(Type objType, string theID, string fieldName)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetFieldValue(theID, fieldName));
        }
示例#29
0
        public IPaginationManager GetPaginationMgr(Type objType, int page_size, string whereStr, string[] columns)
        {
            IDBAccesser accesser = this.CreateDBAccesser(objType);

            return(accesser.GetPaginationMgr(page_size, whereStr, columns));
        }
示例#30
0
        public static object GetFieldValueEx(Type objType, string whereStr, string fieldName)
        {
            IDBAccesser accesser = DataEntrance.GetDestDealer(objType);

            return(accesser.GetFieldValueEx(whereStr, fieldName));
        }