Exemplo n.º 1
0
 public void AddMovie(Movie movie)
 {
     if (movie.MovieSystemService == null)
         movie.MovieSystemService = this;
     DbEntities.AddToMovies(movie);
     Save();
 }
Exemplo n.º 2
0
        public MovieViewModel(Movie movie, List<Review> comments = null)
        {
            this.adult = movie.adult;
            this.backdrop_path = movie.backdrop_path;
            this.id = movie.id;
            this.original_language = movie.original_language;
            this.original_title = movie.original_title;
            this.overview = movie.overview;
            this.release_date = movie.release_date;
            this.poster_path = movie.poster_path;
            this.popularity = movie.popularity;
            this.title = movie.title;
            this.video = movie.video;
            this.vote_average = movie.vote_average;
            this.vote_count = movie.vote_count;

            this.genres = new List<string>();
            foreach (var genre in movie.genres)
                this.genres.Add(genre.name);

            this.production_companies = new List<string>();
            foreach (var production_company in movie.production_companies)
                this.production_companies.Add(production_company.name);

            this.production_countries = new List<string>();
            foreach (var production_country in movie.production_countries)
                this.production_countries.Add(production_country.name);

            this.revenue = movie.revenue;
            this.runtime = movie.runtime;

            this.spoken_languages = new List<string>();
            foreach (var spoken_language in movie.spoken_languages)
                this.spoken_languages.Add(spoken_language.name);

            this.status = movie.status;
            this.tagline = movie.tagline;
            this.IsVisible = true;

            this.Comments = new List<Review>();
            if (comments != null)
                this.Comments = comments;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Saves or updates a movie
        /// </summary>
        /// <param name="movie">The movie.</param>
        public void SaveOrUpdate(Movie movie)
        {
            if (movie == null) {
                throw new ArgumentNullException("movie");
            }

            this.Session.SaveOrUpdate(movie);
        }
Exemplo n.º 4
0
        private void TransferMovie(Movie fromMovie, Movie toMovie)
        {
            if (toMovie.Id == fromMovie.Id)
                throw new InvalidOperationException("Insanity achieved. TransferMovie...");

            foreach (var source in fromMovie.MovieAtStorages.ToList())
                toMovie.MovieAtStorages.Add(source);

            DbEntities.DeleteObject(fromMovie);
        }