Esempio n. 1
0
        private void MainView_Load(object sender, PaintEventArgs e)
        {
            if (!movieGridViewIsLoaded)
            {
                movieGridView.Columns.Add("ID", "");
                movieGridView.Columns.Add("MovieName", "Name");
                var ImageResizeCell = new DataGridViewImageColumn(false);


                movieGridView.Columns.Add(ImageResizeCell);
                movieGridView.Columns.Add("Omschrijving", "Omschrijving");

                var allMovies = _moviesRepository.GetAll();
                foreach (MovieView i in allMovies)
                {
                    System.Net.WebRequest request =
                        System.Net.WebRequest.Create(i.Picture);
                    System.Net.WebResponse response       = request.GetResponse();
                    System.IO.Stream       responseStream = response.GetResponseStream();
                    Bitmap picture      = new Bitmap(responseStream);
                    Image  imageResize  = picture;
                    Bitmap picture2Size = new Bitmap(imageResize, new Size(175, 250));

                    movieGridView.Rows.Add(new object[] { i.Id_Movie, i.Name, picture2Size, i.Description });
                }
                movieGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
                movieGridView.AutoSizeRowsMode    = DataGridViewAutoSizeRowsMode.DisplayedCells;
                movieGridView.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders);
                movieGridViewIsLoaded = true;
            }
        }
Esempio n. 2
0
        private void MainView_Load(object sender, PaintEventArgs e)
        {
            var allMovies = _moviesRepository.GetAll();

            foreach (MovieView i in allMovies)
            {
                movieList.Items.Add(i.Name);
                movieList.Items.Add(i.Genre);
            }
        }
Esempio n. 3
0
 public List <Movie> GetAll()
 {
     return(_movieRepoLib.GetAll());
 }
 public IHttpActionResult Get()
 {
     return(Ok(repository.GetAll()));
 }