public IList<InforHistory> Retrieve(InforHistoryQueryCriteria criteria) { var parameters = new IDataParameter[] { new MySqlParameter("@P_PUBLISHERID", criteria.PublisherId), new MySqlParameter("@P_MD5", criteria.MD5), new MySqlParameter("@P_KEYWORDS", criteria.Keywords), new MySqlParameter("@P_STARTTIME", criteria.StartTime), new MySqlParameter("@P_ENDTIME", criteria.EndTime), new MySqlParameter("@P_STARLEVEL", criteria.StarLevel), new MySqlParameter("@P_PAGESIZE", criteria.PageSize), new MySqlParameter("@P_PAGEINDEX", criteria.PageIndex), new MySqlParameter("@P_TOTALCOUNT", MySqlDbType.Int32) { Direction= ParameterDirection.Output }, }; var inforHistoryList = this.DbRequest.RetrieveTable(this.ConnectionString, "P_InforHistory_Get", parameters).ToModel<InforHistory>(); criteria.Out_TotalCount = Convert.ToInt32(parameters[parameters.Length - 1].Value); return inforHistoryList; }
public InforHistory GetSingleInforHistory(int publisherId, string md5) { var criteria = new InforHistoryQueryCriteria() { PublisherId = publisherId, MD5 = md5 }; var inforHistoryList = _ihRepo.Retrieve(criteria); return inforHistoryList.Count == 0 ? null : inforHistoryList.First(); }
public IList<InforHistory> GetInforHistories(int? publisherId, string keywords, DateTime? startTime, DateTime? endTime, short? starLevel, int pageSize, int pageIndex, out int totalCount) { var criteria = new InforHistoryQueryCriteria() { PublisherId = publisherId, Keywords = string.IsNullOrWhiteSpace(keywords) ? null : keywords.Trim(), StartTime = startTime, EndTime = endTime, StarLevel = starLevel, PageSize = pageSize, PageIndex = pageIndex, }; var inforHistoryList = _ihRepo.Retrieve(criteria); totalCount = criteria.Out_TotalCount; return inforHistoryList; }