예제 #1
0
파일: DHongBao.cs 프로젝트: uwitec/O2O
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="RecordCount"></param>
        /// <param name="serModel"></param>
        /// <returns></returns>
        public IList<HongBao> GetList(int PageSize, int PageIndex, ref int RecordCount, HongBaoSer serModel)
        {
            IList<HongBao> list = new List<HongBao>();

            string tableName = "view_hongbao";
            string fileds = "  ID , UserID , IssueTime , HongBaoJinE,UserName,ContactName    ";
            string orderByString = "IssueTime desc";

            StringBuilder query = new StringBuilder();
            query.AppendFormat(" 1=1 ");

            if (serModel != null)
            {
                if (!string.IsNullOrEmpty(serModel.UserID))
                {
                    query.AppendFormat(" and  userid  = '{0}' ", serModel.UserID);
                }
            }

            using (IDataReader dr = DbHelper.ExecuteReader1(this._db, PageSize, PageIndex, ref RecordCount, tableName, fileds, query.ToString(), orderByString, null))
            {
                while (dr.Read())
                {
                    HongBao model = new HongBao();
                    model.ID = dr.GetString(dr.GetOrdinal("ID"));
                    model.UserID = dr.GetString(dr.GetOrdinal("UserID"));
                    model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    model.HongBaoJinE = dr.GetDecimal(dr.GetOrdinal("HongBaoJinE"));
                    model.UserName = dr.GetString(dr.GetOrdinal("UserName"));
                    model.ContactName = dr.GetString(dr.GetOrdinal("ContactName"));
                    list.Add(model);
                }
            }
            return list;
        }
예제 #2
0
파일: BHongBao.cs 프로젝트: uwitec/O2O
 /// <summary>
 /// 获取分页数据
 /// </summary>
 /// <param name="PageSize"></param>
 /// <param name="PageIndex"></param>
 /// <param name="RecordCount"></param>
 /// <param name="serModel"></param>
 /// <returns></returns>
 public IList<HongBao> GetList(int PageSize, int PageIndex, ref int RecordCount, HongBaoSer serModel)
 {
     return dal.GetList(PageSize, PageIndex, ref RecordCount, serModel);
 }