public MovieActor(Movie m, Actor a, bool NoAdd) { if (NoAdd == true) { Movie = m; Actor = a; } }
private void btnEditMovie_Click(object sender, EventArgs e) { FormEditMovies.SelectedMovie = (Movie)lbMovies.SelectedItem; new FormEditMovie().ShowDialog(); foreach (var k in Movie.Movies.Keys) if (Movie.Movies[k] == FormEditMovies.SelectedMovie) { Movie.Movies[k].Title = FormEditMovies.SelectedMovie.Title; Movie.Movies[k].CountryOfOrigin = FormEditMovies.SelectedMovie.CountryOfOrigin; Movie.Movies[k].ReleaseDate = FormEditMovies.SelectedMovie.ReleaseDate; Movie.Movies[k].Language = FormEditMovies.SelectedMovie.Language; } RefreshlbMovies(); }
public List<Movie> GetAll() { var movies = new List<Movie>(); for (var i = 1; i <= 77; i++) { var movie = new Movie { MovieId = i, Cast = new[] { "Craig", "Someone else" }, Classification = "M15", Genre = "Horror", Rating = 5, ReleaseDate = 2001, Title = "Movie " + i }; movies.Add(movie); } return movies; }
private void lbMovies_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.lbMovies.IndexFromPoint(e.Location); if (index != System.Windows.Forms.ListBox.NoMatches) { FormEditMovies.SelectedMovie = (Movie)lbMovies.SelectedItem; new FormEditMovie().ShowDialog(); foreach (var k in Movie.Movies.Keys) if (Movie.Movies[k] == FormEditMovies.SelectedMovie) { Movie.Movies[k].Title = FormEditMovies.SelectedMovie.Title; Movie.Movies[k].CountryOfOrigin = FormEditMovies.SelectedMovie.CountryOfOrigin; Movie.Movies[k].ReleaseDate = FormEditMovies.SelectedMovie.ReleaseDate; Movie.Movies[k].Language = FormEditMovies.SelectedMovie.Language; } RefreshlbMovies(); } }
public void Create_VerifySubsequentRequestsYieldAnIncrementingMovieId() { var movieRepository = MovieRepository; var movie = new Movie { Title = "Title", Cast = new[] { "someone" }, Classification = "M15", Rating = 5, Genre = "Drama", ReleaseDate = 2014 }; var firstMovieId = movieRepository.Create(movie); var secondMovieId = movieRepository.Create(movie); secondMovieId .Should() .Be(firstMovieId + 1); }
public int Create(Movie movie) { return 1; }
public void Update(Movie movie) { }
public MovieActor(Movie m, Actor a) { Movie = m; Actor = a; MovieActors.Add(this); }
public Task <DataSet <Movie> > GetMovieAsync(_Int32 id, CancellationToken ct = default(CancellationToken)) { return(Movie.Where(_ => _.ID == id).ToDataSetAsync(ct)); }