Example #1
0
        public ActionResult AdvancedSearch(Photo searchModel)
        {
            string          userId = User.Identity.GetUserId();
            ListOfPhotosDto photos = _photoService.Search(searchModel, userId);

            return(View("Index", photos));
        }
Example #2
0
        public ActionResult Search(string name)
        {
            string          userId = User.Identity.GetUserId();
            ListOfPhotosDto photos = _photoService.SearchByName(name, userId);

            return(View("Index", photos));
        }
Example #3
0
        public ListOfPhotosDto SearchByName(string photoName, string userId)
        {
            List <Photo>    photos    = _unitOfWork.Photos.SearchByName(photoName, userId).ToList();
            List <PhotoDto> photoDtos = PreparePhotoDtoList(userId, photos);

            ListOfPhotosDto listOfPhotosDto = new ListOfPhotosDto
            {
                CanBeChanged = true,
                PhotoDtoList = photoDtos
            };

            return(listOfPhotosDto);
        }
Example #4
0
        public ListOfPhotosDto GetPhotoDtosOfTheUser(string userId)
        {
            List <Photo>    photos    = _unitOfWork.Photos.GetPhotosByUserId(userId).ToList();
            List <PhotoDto> photoDtos = PreparePhotoDtoList(userId, photos);

            ListOfPhotosDto listOfPhotosDto = new ListOfPhotosDto
            {
                CanBeChanged = true,
                PhotoDtoList = photoDtos
            };

            return(listOfPhotosDto);
        }