Ejemplo n.º 1
0
 /// <summary>
 /// 返回多行数据
 /// </summary>
 /// <param name="parameters">参数</param>
 /// <param name="count">返回数量(默认20)</param>
 /// <param name="sqlName">SQL语句名称(默认:getdatalist)</param>
 /// <returns></returns>
 public HashObjectList GetDataList(HashObject parameters, string sqlName = "getdatalist", SqlType sqltype = SqlType.SqlName, int count = 0)
 {
     using (DbHelperWrapper dbhelper = new DbHelperWrapper(this._dbrwType, this._dbName, this._tableName, sqlName, parameters, sqltype))
     {
         dbhelper.LogEnable = this.LogEnable;
         HashObjectList result = dbhelper.GetDataList(count);
         return(result);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取指定列的值(传入)
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="selectColumns"></param>
        /// <param name="sqlType"></param>
        /// <returns></returns>
        public HashObjectList GetDataListColumns(HashObject whereParameters, string[] selectColumns, int count = 0)
        {
            //this.CheckForPrimary(parameters);//判断参数中是否包含主键列,如果不包含,抛出异常
            string sql = SchemaManager.GetSelectColumnsSql(this._dbName, this._tableName, whereParameters, selectColumns);

            using (DbHelperWrapper dbhelper = new DbHelperWrapper(this._dbrwType, this._dbName, this._tableName, sql, whereParameters, SqlType.CmdText))
            {
                dbhelper.LogEnable = this.LogEnable;
                HashObjectList result = dbhelper.GetDataList(count);
                return(result);
            }
        }