Пример #1
0
        public EmployeePagedCollection Create(TableRequest request)
        {
            IEnumerable <SimplifiedEmployeeViewModel> toTransfer;

            var totalCount  = 0;
            var queryResult = employeeDataAccessObject.GetNextPage(request, gridPageSize);

            totalCount = queryResult.ResultQuantity;
            toTransfer = employeeService.SimplifyCollection(queryResult.Employees);

            return(new EmployeePagedCollection()
            {
                Employees = toTransfer,
                Page = request.Page,
                TotalPages = employeeService.CalculatePages(gridPageSize, totalCount),
                SortColumn = request.SortingProperty,
                SortOrder = request.SortOrder,
                TotalRecords = totalCount
            });
        }