예제 #1
0
        public ViewResult Index(int?inCinemaFromYear, int?inCinemaFromMonth, int?inCinemaFromDay)
        {
            if (inCinemaFromYear == null)
            {
                inCinemaFromYear = 1800;
            }

            if (inCinemaFromMonth == null)
            {
                inCinemaFromMonth = 1;
            }

            if (inCinemaFromDay == null)
            {
                inCinemaFromDay = 1;
            }

            IEnumerable <Movie> movies = FakeDB.GetMovies()
                                         .Where(m => m.InCinemaFrom >= new DateTime((int)inCinemaFromYear, (int)inCinemaFromMonth, (int)inCinemaFromDay));

            MoviesDataView mDV = new MoviesDataView()
            {
                Movies = movies
            };

            return(View(mDV));
        }
예제 #2
0
        public ViewResult MovieRateDetails(int movieId)
        {
            Movie movie;

            try
            {
                movie = FakeDB.GetMovies().First(x => x.Id == movieId);
            }
            catch
            {
                movie = null;
            }

            return(View(movie));
        }