Esempio n. 1
0
        public ActionResult Watch(WatchMovieModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            watchMovieCommand.Execute(model);
            return(Json(new { redirectToUrl = Url.Action("details", "movies", new { id = model.MovieId }) }));
        }
Esempio n. 2
0
        public ActionResult Watch(int movieId)
        {
            // TODO: Get last watch for this movie from DB -- next number
            var model = new WatchMovieModel
            {
                MovieId = movieId,
                Number  = 1,
                Date    = DateTime.Today
            };

            return(View(model));
        }
Esempio n. 3
0
        public void Execute(WatchMovieModel model)
        {
            var watch = new Watch
            {
                MovieId = model.MovieId,
                Comment = model.Comment,
                Date    = model.Date,
                Number  = model.Number,
                Rating  = model.Rating
            };

            movieRepository.WatchMovie(watch);
        }