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())); }
public ActionResult Details(int id) { var database = new FakeFilmDatabase(); Film film = database.GetById(id); return(View("Details", film)); }
public ActionResult EditFilm(Film c) { var database = new FakeFilmDatabase(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { //int filmId = int.Parse(RouteData.Values["id"].ToString()); var database = new FakeFilmDatabase(); var film = database.GetById(id); return(View(film)); }
public ActionResult DeleteFilm() { int filmId = int.Parse(Request.Form["FilmId"]); var database = new FakeFilmDatabase(); var films = database.GetAll(); return(View("Index", films)); }