Exemplo n.º 1
0
        private void EditMovie(Movie movie)
        {
            if (movie != null)
            {
                var movieDetailForm = new MovieDetailForm(movie);
                movieDetailForm.PlaceValuesInTextBox(movie);
                if (movieDetailForm.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }

                _database.Update(movieDetailForm.Movie);
                UpdateList();
            }
        }
Exemplo n.º 2
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_movie == null)
            {
                MessageBox.Show("There are no movies for you to edit.", "Edit Movie",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            var movieDetailForm = new MovieDetailForm(_movie);

            movieDetailForm.PlaceValuesInTextBox(_movie);
            movieDetailForm.ShowDialog(this);

            _movie = movieDetailForm.Movie;
        }
Exemplo n.º 3
0
        private void EditMovie(Movie movie)
        {
            var movieDetailForm = new MovieDetailForm(movie);

            movieDetailForm.PlaceValuesInTextBox(movie);
            if (movieDetailForm.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            try
            {
                _database.Update(movieDetailForm.Movie);
            }
            catch (Exception er)
            {
                DisplayError(er);
            }
            UpdateList();
        }