コード例 #1
0
ファイル: Users.cs プロジェクト: nm-1216/QfbServer
        /// <summary>
        /// GetDataSet 获取分页数据集
        /// </summary>
        /// <param name="pageSize">pageSize 每页条数</param>
        /// <param name="currPage">currPage 当前页码</param>
        /// <param name="recordCount">recordCount 总记录数</param>
        /// <param name="dataParams">dataParams 查询参数</param>
        /// <returns>返回 数据集</returns>
        public DataSet GetDataSet(int pageSize, int currPage, out int recordCount, string strWhere, params DbParameter[] dataParams)
        {
            recordCount = 0;
            if (DataActions.select != this.Action)
            {
                return(null);
            }

            proc_common_GetRecord pcg = new proc_common_GetRecord("[dbo].[Users]", "Id", "*", strWhere, string.Empty, pageSize, currPage);

            Database  db  = DatabaseFactory.CreateDatabase(QfbServer.Models.User.CONN);
            DbCommand dbc = db.GetSqlStringCommand(pcg.TSQL);

            if (null != dataParams)
            {
                dbc.Parameters.AddRange(dataParams);
            }

            var ds = db.ExecuteDataSet(dbc);

            recordCount = int.Parse(ds.Tables[0].Rows[0][0].ToString());

            return(ds);
        }
コード例 #2
0
        /// <summary>
        /// GetDataSet 获取分页数据集
        /// </summary>
        /// <param name="pageSize">pageSize 每页条数</param>
        /// <param name="currPage">currPage 当前页码</param>
        /// <param name="recordCount">recordCount 总记录数</param>
        /// <param name="dataParams">dataParams 查询参数</param>
        /// <returns>返回 数据集</returns>
        public DataSet GetDataSet(int pageSize, int currPage, out int recordCount, string strWhere, params DbParameter[] dataParams)
        {
            recordCount = 0;
            if (DataActions.select != this.Action)
            {
                return(null);
            }

            proc_common_GetRecord pcg = new proc_common_GetRecord("[dbo].[BankOut]", "WithdrawMoney_Ids", "*", strWhere, string.Empty, pageSize, currPage);

            Database  db  = DatabaseFactory.CreateDatabase(Os.Brain.iBxg.Core.Entity.BankOut.CONN);
            DbCommand dbc = db.GetSqlStringCommand(pcg.TSQL);

            if (null != dataParams)
            {
                dbc.Parameters.AddRange(dataParams);
            }

            var ds = db.ExecuteDataSet(dbc);

            recordCount = int.Parse(ds.Tables[0].Rows[0][0].ToString());

            return(ds);
        }