Exemplo n.º 1
0
 /// <summary>
 /// 获取分页列表
 /// </summary>
 /// <param name="PageSize">每页显示条数</param>
 /// <param name="PageIndex">当前页数</param>
 /// <param name="RecordCount">总页数</param>
 /// <param name="serModel">搜索实体</param>
 /// <returns></returns>
 public IList <Eyousoft_yhq.Model.MsgLog> GetList(int PageSize, int PageIndex, ref int RecordCount, Eyousoft_yhq.Model.serMsgLog serModel)
 {
     return(dal.GetList(PageSize, PageIndex, ref RecordCount, serModel));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获取发送列表
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="RecordCount"></param>
        /// <param name="serModel"></param>
        /// <param name="i"></param>
        /// <returns></returns>
        public IList <Eyousoft_yhq.Model.MsgLog> GetList(int PageSize, int PageIndex, ref int RecordCount, Eyousoft_yhq.Model.serMsgLog serModel)
        {
            IList <Eyousoft_yhq.Model.MsgLog> list = new List <Eyousoft_yhq.Model.MsgLog>();


            string tableName     = "tbl_MsgLog";
            string fileds        = "  msgID,TelCode,MsgText,ReResult,Issuetime  ";
            string orderByString = " msgID desc";

            StringBuilder query = new StringBuilder();

            query.Append(" 1=1  ");

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


            using (IDataReader dr = DbHelper.ExecuteReader1(this._db, PageSize, PageIndex, ref RecordCount, tableName, fileds, query.ToString(), orderByString, null))
            {
                while (dr.Read())
                {
                    Eyousoft_yhq.Model.MsgLog model = new Eyousoft_yhq.Model.MsgLog();
                    model.msgid     = dr.GetInt32(dr.GetOrdinal("msgID"));
                    model.TelCode   = dr.IsDBNull(dr.GetOrdinal("TelCode")) ? "" : dr.GetString(dr.GetOrdinal("TelCode"));
                    model.MsgText   = dr.IsDBNull(dr.GetOrdinal("MsgText")) ? "" : dr.GetString(dr.GetOrdinal("MsgText"));
                    model.ReResult  = dr.IsDBNull(dr.GetOrdinal("ReResult")) ? "" : dr.GetString(dr.GetOrdinal("ReResult"));
                    model.Issuetime = dr.GetDateTime(dr.GetOrdinal("ProductID"));

                    list.Add(model);
                }
            }
            return(list);
        }