public ActionResult DoCreate(GenreInput input) { var genre = input.CreateGenre(FilmsDao); GenresDao.Add(genre); return(RedirectToAction("Index")); }
public MainView() { InitializeComponent(); _personDao = new PersonDao(); _movieDao = new MovieDao(); _authorization = new Authorization(); _genresDao = new GenresDao(); _countriesDao = new CountriesDao(); }
public ActionResult Create() { return(View(new FilmInfoContainer() { AvailableActors = ActorsDao.FindAll(), AvailableDirectors = DirectorsDao.FindAll(), AvailableGenres = GenresDao.FindAll() })); }
//GET: Genres/Films public ActionResult Films(Guid id) { var genre = GenresDao.GetGenreWithFilms(id); return(View(new GenreAndFilmsView { Films = genre?.Films.Select(f => new FilmView(f)).OrderBy(f => f.Title), Genre = genre })); }
public AddMovieView() { InitializeComponent(); _castDao = new CastDao(); _personDao = new PersonDao(); _genresDao = new GenresDao(); _countriesDao = new CountriesDao(); _crewDao = new CrewDao(); _movieDao = new MovieDao(); }
public MovieView(int movieId) { _countriesDao = new CountriesDao(); _genresDao = new GenresDao(); _movie = new MovieDao().GetMovieById(movieId); _castDao = new CastDao(); _crewDao = new CrewDao(); _reviewsDao = new ReviewsDao(); _personDao = new PersonDao(); InitializeComponent(); }
public ActionResult Edit(Guid id) { var film = FilmsDao.GetFilmWithFullInfo(id); return(View(new FilmInfoContainer() { Film = new FilmView(film), AvailableActors = ActorsDao.GetActorsWithoutFilm(film.ID), AvailableDirectors = DirectorsDao.FindAll(), AvailableGenres = GenresDao.GetGenresWithoutFilm(film.ID) })); }
public DataRetriever() { _castDao = new CastDao(); _genresDao = new GenresDao(); _countriesDao = new CountriesDao(); _httpRetriever = new HttpRetriever(); _movieDao = new MovieDao(); _crewDao = new CrewDao(); _personDao = new PersonDao(); _authorization = new Authorization(); _reviewsDao = new ReviewsDao(); }
public static void Main(string[] args) { GenresDao.Add(new Genre("Drama")); GenresDao.Add(new Genre("Comedy")); MoviesDao.Add(new Movie("Inherent Vice", new DateTime(2014, 12, 12), 1)); MoviesDao.Add(new Movie("Knocked Up", new DateTime(2007, 06, 01), 2)); MoviesDao.Add(new Movie("The Rules of Attraction", new DateTime(2002, 10, 11), 2)); MoviesDao.Add(new Movie("The Big Lebowski", new DateTime(1998, 03, 06), 2)); ActorsDao.Add(new Actor("Michelle Anne Sinclair", new DateTime(1981, 05, 21)));; ActorsDao.Add(new Actor("Stephanie Clifford", new DateTime(1979, 03, 17))); ActorsDao.Add(new Actor("Aurora Snow", new DateTime(1981, 11, 26))); ActorsDao.Add(new Actor("Jessica Steinhauser", new DateTime(1973, 08, 06))); MovieActorDao.Add((1, 1)); MovieActorDao.Add((2, 2)); MovieActorDao.Add((3, 3)); MovieActorDao.Add((4, 4)); }
// GET: Home public ActionResult Index([ModelBinder(typeof(UserModelBinder))] User user) { var info = new FilmsSearchInfoBase() { Genres = GenresDao.FindAll() .OrderBy(g => g.Name), Actors = ActorsDao.FindAll() .Select(a => new ActorView(a)) .OrderBy(a => a.FullName) .ToList(), FilmsDefaultView = FilmsDao.FindAllWithGenres() .Select(f => new FilmView(f) { IsFav = user.HasFavourite(f.ID) }) .OrderByDescending(f => f.ReleaseDate) }; return(View(info)); }
public ActionResult Search(string q) { var genres = GenresDao.SearchGenresByName(q); return(View(genres.OrderBy(f => f.Name))); }
// GET: Genres public ActionResult Index() { return(View(GenresDao.FindAll().OrderBy(g => g.Name))); }