예제 #1
0
        /// <summary>
        /// 构造DBExtend
        /// </summary>
        /// <param name="_dbContext"></param>
        public AbsDBExtend(DbContext _dbContext)
        {
            dbContext = _dbContext;
            var _helper = _dbContext.DBHelper;

            if (_helper == null)
            {
                throw new CRLException("数据访问对象未实例化,请实现CRL.SettingConfig.GetDbAccess");
            }
            GUID     = Guid.NewGuid();
            dbHelper = _helper;
        }
예제 #2
0
        public override string PageSqlFormat(CoreHelper.DBHelper db, string fields, string rowOver, string condition, int start, int end, string sort)
        {
            start -= 1;
            if (start < 0)
            {
                start = 0;
            }
            db.AddParam("?start", start);
            db.AddParam("?row", end - start);
            string sql = "SELECT {0} {1} {4} limit {2},{3} ";

            return(string.Format(sql, fields, condition, "?start", "?row", string.IsNullOrEmpty(sort) ? "" : "order by " + sort));
        }
예제 #3
0
 internal void FillParame(CoreHelper.DBHelper db)
 {
     foreach (var kv in _Parame)
     {
         db.AddParam(kv.Key, kv.Value);
     }
     foreach (var kv in _OutParame)
     {
         db.AddOutParam(kv.Key, kv.Value);
     }
     _Parame.Clear();
     _OutParame.Clear();
 }