Exemplo n.º 1
0
        public void OnGet()
        {
            if (Location == null)
            {
                return;
            }
            SetDisplayedBoundaries();
            if (SortBy == null)
            {
                SortBy = SortColumns.Temperature;
            }
            switch (SortBy)
            {
            case SortColumns.Date:
                if (SortDir == null)
                {
                    SortDir = SortDirection.Ascending;
                }

                break;

            case SortColumns.Temperature:
                if (SortDir == null)
                {
                    SortDir = SortDirection.Descending;
                }

                break;

            case SortColumns.Humidity:
                if (SortDir == null)
                {
                    SortDir = SortDirection.Ascending;
                }

                break;

            case SortColumns.MoldRisk:
                if (SortDir == null)
                {
                    SortDir = SortDirection.Ascending;
                }

                break;

            default:
                break;
            }
            Data = _ws.GetAllAveragessForLocation(Location.Value, SortBy.Value, SortDir.Value)
                   .Skip((PageIndex - 1) * PageSize).Take(PageSize);
        }