Пример #1
0
        public ActionResult Search(string searchBy, string searchType)
        {
            var database = new FakeFilmDatabase();

            IEnumerable <Film> results;

            if (searchType == "Title")
            {
                results = database.GetAll().Where(m => m.Title.Contains(searchBy));
                return(View("IndexSearch", results));
            }

            if (searchType == "Director")
            {
                results = database.GetAll().Where(m => m.Director.Contains(searchBy));
                return(View("IndexSearch", results));
            }

            if (searchType == "Actors")
            {
                results = database.GetAll().Where(m => m.Actor.Contains(searchBy));
                return(View("IndexSearch", results));
            }

            return(View("Index", database.GetAll()));
        }
Пример #2
0
        public ActionResult DeleteFilm()
        {
            int filmId = int.Parse(Request.Form["FilmId"]);

            var database = new FakeFilmDatabase();


            var films = database.GetAll();

            return(View("Index", films));
        }