Exemplo n.º 1
0
 /// <summary>
 /// can be passed error code message JsonPagerResult
 /// </summary>
 /// <param name="errorCode"></param>
 /// <param name="errorMessage"></param>
 /// <param name="dataSource"></param>
 /// <param name="pagingOptions"></param>
 /// <param name="totalRecordCount"></param>
 public JsonPagerResult(int errorCode, string errorMessage, object dataSource, PagingOptions pagingOptions, int totalRecordCount)
     : base(dataSource)
 {
     Error = errorCode;
     ErrorMessage = errorMessage;
     InitJsonPagerResult(dataSource,pagingOptions, totalRecordCount);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Init JsonPagerResult
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="pagingOptions"></param>
        /// <param name="totalRecordCount"></param>
        private void InitJsonPagerResult(object dataSource, PagingOptions pagingOptions, int totalRecordCount)
        {
            DataSource = dataSource;
            PageSize = pagingOptions.PageSize;
            PageNumber = pagingOptions.PageNumber;
            TotalPages = (totalRecordCount / pagingOptions.PageSize);
            TotalRecordsCount = totalRecordCount;

            if (0 < (totalRecordCount % pagingOptions.PageSize))
            {
                TotalPages++;
            }
        }
Exemplo n.º 3
0
 public JsonPagerResult(object dataSource, PagingOptions pagingOptions, int totalRecordCount)
     : base(dataSource)
 {
     InitJsonPagerResult(dataSource, pagingOptions, totalRecordCount);
 }