public int GetPageCount(out int totalNum) { totalNum = 0; var pageCount = 1; try { //totalNum = DatabaseApi.Instance.GetPageTotalCount(SqlString); totalNum = StlDatabaseCache.GetPageTotalCount(_sqlString); if (_listInfo.PageNum != 0 && _listInfo.PageNum < totalNum) //需要翻页 { pageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(totalNum) / Convert.ToDouble(_listInfo.PageNum))); //需要生成的总页数 } } catch { // ignored } return(pageCount); }
public int GetPageCount(out int totalNum) { totalNum = 0; var pageCount = 1; try { //totalNum = DataProvider.DatabaseDao.GetPageTotalCount(SqlString); totalNum = StlDatabaseCache.GetPageTotalCount(SqlString); if (ListInfo.PageNum != 0 && ListInfo.PageNum < totalNum) //需要翻页 { pageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(totalNum) / Convert.ToDouble(ListInfo.PageNum))); //需要生成的总页数 } } catch (Exception ex) { LogUtils.AddStlErrorLog(_pageInfo, ElementName, _stlPageContentsElement, ex); } return(pageCount); }