Example #1
0
        /// <summary>
        /// 查询数据列表、返回 DataTable
        /// </summary>
        /// <param name="strSql">Sql语句</param>
        /// <param name="parameters">sql语句对应参数</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        public DataTable FindTablePageBySql(string strSql, DbParameter[] parameters, ref JqGridParam jqgridparam)
        {
            string    orderField = jqgridparam.sidx;
            string    orderType  = jqgridparam.sord;
            int       pageIndex  = jqgridparam.page;
            int       pageSize   = jqgridparam.rows;
            int       totalRow   = jqgridparam.records;
            DataTable dt         = DataFactory.Database().FindTablePageBySql(strSql, parameters, orderField, orderType, pageIndex, pageSize, ref totalRow);

            jqgridparam.records = totalRow;
            return(dt);
        }
Example #2
0
        /// <summary>
        /// 查询数据列表、返回List
        /// </summary>
        /// <param name="strSql">Sql语句</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        public List <T> FindListPageBySql(string strSql, ref JqGridParam jqgridparam)
        {
            string   orderField = jqgridparam.sidx;
            string   orderType  = jqgridparam.sord;
            int      pageIndex  = jqgridparam.page;
            int      pageSize   = jqgridparam.rows;
            int      totalRow   = jqgridparam.records;
            List <T> List       = DataFactory.Database().FindListPageBySql <T>(strSql, orderField, orderType, pageIndex, pageSize, ref totalRow);

            jqgridparam.records = totalRow;
            return(List);
        }