Esempio n. 1
0
        /// <summary>
        /// me_会员排行榜使用
        /// </summary>
        /// <param name="p_pageIndex">当前页</param>
        /// <param name="p_pageSize">分页大小</param>
        /// <param name="p_recordCount">返回总记录数</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="strOrder">排序条件</param>
        /// <returns>IList User</returns>
        public IList <BCW.farm.Model.NC_user> GetUsers(int p_pageIndex, int p_pageSize, string strWhere, string strOrder, out int p_recordCount)
        {
            IList <BCW.farm.Model.NC_user> listUsers = new List <BCW.farm.Model.NC_user>();
            string sTable     = "tb_NC_user";
            string sPkey      = "id";
            string sField     = "*";
            string sCondition = strWhere;
            string sOrder     = strOrder;
            int    iSCounts   = 0;

            using (SqlDataReader reader = SqlHelperUser.RunProcedureMe(sTable, sPkey, sField, p_pageIndex, p_pageSize, sCondition, sOrder, iSCounts, out p_recordCount))
            {
                //计算总页数
                if (p_recordCount > 0)
                {
                    if (p_recordCount > 100)
                    {
                        p_recordCount = 100;
                    }
                    int pageCount = BasePage.CalcPageCount(p_recordCount, p_pageSize, ref p_pageIndex);
                }
                else
                {
                    return(listUsers);
                }
                while (reader.Read())
                {
                    BCW.farm.Model.NC_user objNC_user = new BCW.farm.Model.NC_user();
                    objNC_user.ID         = reader.GetInt32(0);
                    objNC_user.usid       = reader.GetInt32(1);
                    objNC_user.Grade      = reader.GetInt32(2);
                    objNC_user.Goid       = reader.GetInt64(3);
                    objNC_user.Experience = reader.GetInt64(4);
                    objNC_user.ischan     = reader.GetInt32(5);
                    objNC_user.iszhong    = reader.GetInt32(6);
                    objNC_user.iscao      = reader.GetInt32(7);
                    objNC_user.iswater    = reader.GetInt32(8);
                    objNC_user.isinsect   = reader.GetInt32(9);
                    objNC_user.isshou     = reader.GetInt32(10);
                    objNC_user.isshifei   = reader.GetInt32(11);
                    objNC_user.SignTime   = reader.GetDateTime(12);
                    objNC_user.SignTotal  = reader.GetInt32(13);
                    objNC_user.SignKeep   = reader.GetInt32(14);
                    objNC_user.tuditpye   = reader.GetInt32(15);
                    listUsers.Add(objNC_user);
                }
            }
            return(listUsers);
        }