/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(string min, string max, string category) { /* Call the DAL and pass the values as a model back to the View */ IList <Film> filmList = dal.GetFilmsBetween(category, int.Parse(min), int.Parse(max)); return(View(filmList)); }
//public HttpResponseMessage GetFilms() //{ // var films = _films.GetAllFilms(); // return Request.CreateResponse(HttpStatusCode.OK, films); //} public HttpResponseMessage GetFilmsBetween(string genre, int minLength, int maxLength) { Thread.Sleep(5000); var films = _films.GetFilmsBetween(genre, minLength, maxLength); return(Request.CreateResponse(HttpStatusCode.OK, films)); }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> /// public ActionResult SearchResult(FilmSearchModel films) { /* Call the DAL and pass the values as a model back to the View */ var filmList = dal.GetFilmsBetween(films.Genre, films.MinLength, films.MaxLength); return(View("SearchResult", filmList)); //revisit }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(FilmSearch filmSearch) { /* Call the DAL and pass the values as a model back to the View */ IList <Film> films = filmDAL.GetFilmsBetween(filmSearch.Genre, filmSearch.MinimumLength, filmSearch.MaximumLength); return(View(films)); }
//public ActionResult Index(FilmSearchModel searchModel) //{ // IndexData model = new IndexData(); // model.Categorys = dal.GetCategoryNames(); // model.Films = dal.GetFilmsBetween(searchModel.Genre, searchModel.MaxLength, searchModel.MinLength); // return View("Index", model); //} /// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> /// public ActionResult SearchResult(FilmSearchModel searchModel) { IndexData model = new IndexData(); model.Films = dal.GetFilmsBetween(searchModel.Genre, searchModel.MaxLength, searchModel.MinLength); model.Categorys = dal.GetCategoryNames(); return(View("SearchResult", model)); }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(Film film) { var films = filmDAO.GetFilmsBetween(film.genre, film.minLength, film.maxLength); film.Results = films; /* Call the DAL and pass the values as a model back to the View */ return(View(film)); }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> //public ActionResult SearchResult(/*FilmSearch request */) //public ActionResult SearchResult(string genre, int? minLength, int? maxLength) //{ // //IList<Film> filmlist = dal.GetFilmsBetween(film.Length); // IList<Film> filmList = dal.GetFilmsBetween(genre, minLength?? 0, maxLength?? 60*24); // return View("SearchResult", filmList); // /* Call the DAL and pass the values as a model back to the View */ //} public ActionResult SearchResult(FilmSearchViewModel filmSearch) { //IList<Film> filmlist = dal.GetFilmsBetween(film.Length); IList <Film> filmList = dal.GetFilmsBetween(filmSearch.Genre, filmSearch.MinLength ?? 0, filmSearch.MaxLength ?? 60 * 24); return(View("SearchResult", filmList)); /* Call the DAL and pass the values as a model back to the View */ }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(string genre, int minLength, int maxLength) { //http://localhost:50749/film/searchresult?category=comedy&minlength=60&maxlength=120 /* Call the DAL and pass the values as a model back to the View */ IList <Film> filmList = filmDal.GetFilmsBetween(genre, minLength, maxLength); //return View(filmList); return(View(filmList)); }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(string genre, int minLength = 0, int maxLength = 1000) { _filmSearchModel.Films.Clear(); IList <Film> films = _filmDal.GetFilmsBetween(genre, minLength, maxLength); _filmSearchModel.Films.AddRange(films); return(View(_filmSearchModel)); }
/// <summary> /// Receives the search result request and goes to th database looking for the information. /// </summary> /// <param name="request">A request model that contains the search parameters.</param> /// <returns></returns> public ActionResult SearchResult(FilmSearch model) { /* Call the DAL and pass the values as a model back to the View */ if (model.MinLength == null) { model.MinLength = 0; } if (model.MaxLength == null) { model.MaxLength = 1000; } model.FilmResults = dal.GetFilmsBetween(model.Genre, (int)model.MinLength, (int)model.MaxLength); return(View(model)); }