Exemplo n.º 1
0
        private static TViewModel JqGridViewModelFactory(StaticPagedList <TQueryDto> listOfDto)
        {
            var viewModel = new TViewModel
            {
                CurrentPageNumber    = listOfDto.PageNumber,
                TotalNumberOfPages   = listOfDto.PageCount,
                TotalNumberOfRecords = listOfDto.TotalItemCount,
                Records = listOfDto.ToList()
            };

            return(viewModel);
        }
Exemplo n.º 2
0
        public static TReturnViewModel JqGridViewModelFactory <TReturnViewModel, QueryDto>(StaticPagedList <QueryDto> listOfDto)
            where TReturnViewModel : GenericJqGridViewModel <QueryDto>, new()
            where QueryDto : class
        {
            var viewModel = new TReturnViewModel
            {
                Records              = listOfDto.ToList(),
                CurrentPageNumber    = listOfDto.PageNumber,
                TotalNumberOfPages   = listOfDto.PageCount,
                TotalNumberOfRecords = listOfDto.TotalItemCount,
            };

            return(viewModel);
        }