public void ReCulculateDataHolder() { try { if (Index > (TotalCount / PageSize) && Index != 0) { Index = (TotalCount / PageSize) - 1; if (Index < 0) { Index = 0; } } #region Culculate PageIndexer MaxPage = (TotalCount / PageSize) + 1; if (TotalCount % PageSize == 0 && TotalCount > 0) { MaxPage--; } var minIndx = (Index / PageSizeIndexer) * PageSizeIndexer; var maxIndx = (((Index / PageSizeIndexer) + 1) * PageSizeIndexer) - 1; MaxDotIndex = -1; MinDotIndex = -1; IndexMin = 0; IndexMax = 0; if ((maxIndx + 1) > MaxPage) { maxIndx = MaxPage - 1; } if (minIndx - 1 >= 0) { MinDotIndex = minIndx - 1; } if (maxIndx + 1 <= (MaxPage - 1)) { MaxDotIndex = maxIndx + 1; } IndexMin = MinDotIndex != -1 ? MinDotIndex : minIndx; IndexMax = MaxDotIndex != -1 ? MaxDotIndex : maxIndx; #endregion } catch (Exception e) { ThisAppContext.AddLogInDb(e); } }
public void AddFilterCount(string filterName, int count) { try { if (_numberOfDataListByFilter == null) { _numberOfDataListByFilter = new Dictionary <string, int>(); } if (_numberOfDataListByFilter.ContainsKey(filterName)) { _numberOfDataListByFilter[filterName] = count; } else { _numberOfDataListByFilter.Add(filterName, count); } } catch (Exception e) { ThisAppContext.AddLogInDb(e); } }