Exemplo n.º 1
0
        public bool UpdateNumberOfViews(string id)
        {
            var movie = _movieService.GetById(id);

            movie.NumberOfViews += 1;
            _movieService.Update(movie);
            return(true);
        }
Exemplo n.º 2
0
        public static DetailsViewModel Invoke(EntityTypes entityType, string id)
        {
            IMedia result = null;

            if (entityType == EntityTypes.Movies)
            {
                result = _movieManagementService.GetById(id);
            }
            if (entityType == EntityTypes.Songs)
            {
                result = _songManagementService.GetById(id);
            }
            if (entityType == EntityTypes.Books)
            {
                result = _bookManagementService.GetById(id);
            }

            return(new DetailsViewModel
            {
                FullSizeImagePath = result.FullSizeImagePath,
                Name = result.Name,
                ReleaseDate = result.ReleaseDate,
                StreamingUrl = result.StreamingUrl,
                CoverArtistDisplayName = result.CoverArtistDisplayName,
                Genre = result.Genre
            });
        }
Exemplo n.º 3
0
        public ActionResult Edit(string id)
        {
            var movie = _movieService.GetById(id);

            movie.IdString  = id.ToString();
            ViewBag.Genre   = movie.Genre;
            ViewBag.Section = movie.SectionId;
            return(View("EditMovie", movie));
        }
Exemplo n.º 4
0
        public ActionResult Index(int entityType, string id)
        {
            ViewBag.EntityType = entityType;
            ViewBag.Id         = id;
            var movieItem = _movieManagementService.GetById(id);

            movieItem.FullSizeImagePath = ControllerConstants.ImagePath + movieItem.FullSizeImagePath ?? String.Empty;
            return(View(movieItem));
        }
 public MovieDto GetMovieByID(int id)
 {
     return(service.GetById(id));
 }