Ejemplo n.º 1
0
        public ActionResult Index(string movieList, double defaultRentalRate, int defaultQty)
        {
            string[] titles = titles = Regex.Split(movieList, "\r\n|\r|\n");

            List <string> unresolvedTitles = new List <string>();
            List <Movie>  resolvedMovie    = new List <Movie>();

            foreach (string title in titles)
            {
                Movie m = OMDBService.GetMoviesByTitle(title);
                if (m != null)
                {
                    m.RentalRate = defaultRentalRate;
                    m.NoInStock  = defaultQty;
                    resolvedMovie.Add(m);
                }
                else
                {
                    if (!string.IsNullOrEmpty(title))
                    {
                        unresolvedTitles.Add(title);
                    }
                }
            }

            BulkLoadOutput blo = new BulkLoadOutput(unresolvedTitles, resolvedMovie);

            TempData["blo"] = blo;
            return(View("BulkOutput", blo));
        }
        /// <summary>
        /// Get the json response and bind it to the controls
        /// </summary>
        public async void GetMovieData()
        {
            string      strMovieTitle = Intent.GetStringExtra("MovieName") ?? "Data Not Available";
            OMDBService service       = new OMDBService();
            var         moviedetail   = await service.GetMovie(strMovieTitle, "");

            MovieDetails = moviedetail;

            if (MovieDetails.Poster.ToUpper() != "N/A")
            {
                var imageBitmap = GetImageBitmapFromUrl(MovieDetails.Poster);
                imgPoster.SetImageBitmap(imageBitmap);
            }

            txtGenre.Text      = GetLines(MovieDetails.Genre).ToString();
            txtYear.Text       = MovieDetails.Year;
            txtIMDBVotes.Text  = MovieDetails.IMDBVotes;
            txtIMDBRating.Text = MovieDetails.IMDBRating;
            txtMovieTitle.Text = MovieDetails.Title;
            txtActors.Text     = GetLines(MovieDetails.Actors).ToString();
            txtWriters.Text    = GetLines(MovieDetails.Writer).ToString();
            txtLanguage.Text   = GetLines(MovieDetails.Language).ToString();
            txtDirector.Text   = GetLines(MovieDetails.Director).ToString();
            txtCountry.Text    = GetLines(MovieDetails.Country).ToString();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get Moviesdata Based on search criteria.
        /// </summary>
        /// <param name="searchtext"></param>
        public async void GetMovieData(string searchtext)
        {
            if (searchtext.Length >= 3)
            {
                var jsondictionary = new Dictionary <string, string> {
                    { "s", searchtext }
                };
                JsonValue jsonresultset = await OMDBService.GetInstanse().Get(RequestType.FIND_MOVIE, jsondictionary);

                if (jsonresultset.ContainsKey("Search"))
                {
                    Lstmovies.Clear();
                    var searchresults = jsonresultset ["Search"];
                    for (int i = 0; i < searchresults.Count; i++)
                    {
                        if (searchresults [i].ContainsKey("Title"))
                        {
                            Lstmovies.Add(new Movie
                            {
                                Title  = searchresults [i] ["Title"],
                                Year   = searchresults [i] ["Year"],
                                IMDBID = searchresults [i] ["imdbID"],
                                Type   = searchresults [i] ["Type"],
                                Poster = searchresults [i] ["Poster"]
                            });
                        }
                    }
                }
                _moviesListView.MoviesList = Lstmovies;
            }
            else
            {
                _moviesListView.AlertMessage();
            }
        }
Ejemplo n.º 4
0
 public Movieseek()
 {
     _OMDBService = new OMDBService();
     _APIService  = new APIService();
     InitializeComponent();
     InitializeOMDBDataSource();
     UpdateMyListDataSource();
 }
Ejemplo n.º 5
0
 public void GetMovieData()
 {
     Assert.IsNotNull(OMDBService.GetMovieDataAsync("office+space").Result);
 }
        public ActionResult OMDBSearch(string title)
        {
            Movie m = OMDBService.GetMoviesByTitle(title);

            return(Json(m));
        }