public PagedViewModelsContainer GetSearchs(int GenreID = 0, int Year = 0, int Type = 0, string Search = "")
        {
            var Query = new ReleaseSearchModel(Search, Year, Type, GenreID);
            var ViewModel = new PagedViewModelsContainer();
            ViewModel.Items = Uow.ReleaseRepository.SearchQuery(Query)
                                 .ReleasesToViewModelsWithImage();

            return ViewModel;
        }
        public PagedViewModelsContainer GetSearchs(int ClientID, int Year, int Type = 0, string Search = "")
        {
            var Query = new ProjectSearchModel(Search, Year, Type, ClientID);
            var ViewModel = new PagedViewModelsContainer();
            ViewModel.Items = Uow.ProjectRepository.SearchQuery(Query)
                                 .ProjectsToViewModelsWithImage();

            return ViewModel;
        }
        // GET api/apirelease
        public PagedViewModelsContainer GetAll(int page = 1, int _pageSize = 0)
        {
            _pageSize = _pageSize == 0 ? pageSize : _pageSize;
            var ViewModel = new PagedViewModelsContainer();

            int itemsleft = Uow.ReleaseRepository.GetAll().Count() - (page * _pageSize);
            ViewModel.ItemsLeft = itemsleft < 0 ? 0 : itemsleft;
            ViewModel.isGotMoreItems = itemsleft > 0 ? true : false;
            ViewModel.Items = Uow.ReleaseRepository.GetAllDescByReleaseDate("Label")
                                    .Skip(--page * _pageSize)
                                    .Take(_pageSize)
                                    .ReleasesToViewModelsWithImage();

            return ViewModel;
        }
Exemple #4
0
        // GET api/apinews
        public PagedViewModelsContainer Get(int page = 1, int _pageSize = 0)
        {
            _pageSize = _pageSize == 0 ? pageSize : _pageSize;

            var ViewModel = new PagedViewModelsContainer();
            int itemsleft = Uow.NewsRepository.GetAll().Count() - (page * _pageSize);
            ViewModel.ItemsLeft = itemsleft < 0 ? 0 : itemsleft;
            ViewModel.isGotMoreItems = itemsleft > 0 ? true : false;
            ViewModel.Items = Uow.NewsRepository.GetAllDesc()
                                    .Skip(--page * _pageSize)
                                    .Take(_pageSize)
                                    .ToViewModelsImageDetail();

            return ViewModel;
        }
        // GET api/apiProjects
        public PagedViewModelsContainer GetAll(int page = 1, int _pageSize = 0)
        {
            _pageSize = _pageSize == 0 ? pageSize : _pageSize;

            var ViewModel = new PagedViewModelsContainer();
            int itemsleft = Uow.ProjectRepository.GetAll().Count() - (page * _pageSize);
            ViewModel.ItemsLeft = itemsleft < 0 ? 0 : itemsleft;
            ViewModel.isGotMoreItems = itemsleft > 0 ? true : false;
            ViewModel.Items = Uow.ProjectRepository.GetAll("Client").OrderBy(o => o.Priority)
                                    .Skip(--page * _pageSize)
                                    .Take(_pageSize)
                                    .ProjectsToViewModelsWithImage();

            return ViewModel;
        }