private void addToolStripMenuItem_Click(object sender, EventArgs e) { var movieDetailForm = new MovieDetailForm(); movieDetailForm.ShowDialog(this); _movie = movieDetailForm.Movie; }
private void OnAdd(object sender, EventArgs e) { var movieDetailForm = new MovieDetailForm(); if (movieDetailForm.ShowDialog(this) != DialogResult.OK) { return; } _database.Add(movieDetailForm.Movie); UpdateList(); }
private void OnMovieAdd(object sender, EventArgs e) { var child = new MovieDetailForm(); if (child.ShowDialog() != DialogResult.OK) { return; } //TODO: Save Movie _movie = child.Movie; }
private void OnMovieAdd(object sender, EventArgs e) { var child = new MovieDetailForm(); if (child.ShowDialog() != DialogResult.OK) { return; } //Save Movie _database.Add(child.Movie); RefreshList(); }
private void EditMovie(Movie movie) { var child = new MovieDetailForm(); child.Movie = movie; if (child.ShowDialog() != DialogResult.OK) { return; } //Save Movie _database.Update(child.Movie); RefreshList(); }
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(); } }
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; }
private void TitleAdd(object sender, EventArgs e) { var button = sender as ToolStripMenuItem; var form = new MovieDetailForm("Add Title"); //Show form modally var result = form.ShowDialog(this); if (result != DialogResult.OK) { return; } }
private void OnMovieEdit(object sender, EventArgs e) { if (_movie == null) { MessageBox.Show("No movie defined YET!", "Error"); return; } var child = new MovieDetailForm(); child.Movie = _movie; if (child.ShowDialog() != DialogResult.OK) { return; } //TODO: Save Movie _movie = child.Movie; }
private void OnAdd(object sender, EventArgs e) { var movieDetailForm = new MovieDetailForm(); if (movieDetailForm.ShowDialog(this) != DialogResult.OK) { return; } try { _database.Add(movieDetailForm.Movie); } catch (Exception er) { DisplayError(er); } UpdateList(); }
private void OnTitleEdit(object sender, EventArgs e) { //Get selected Title var _title = GetSeletedTitle(); if (_title == null) { return; } var form = new MovieDetailForm(_title); var result = form.ShowDialog(this); if (result != DialogResult.OK) { return; }
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(); }
private void OnMoviesEdit(object sender, EventArgs e) { //If there is no movie, show error dialog. if (_movie == null) { MessageBox.Show(this, "No movie to edit", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var child = new MovieDetailForm(); child.Movie = _movie; if (child.ShowDialog(this) != DialogResult.OK) { return; } //Save Movie _movie = child.Movie; }
private void EditMovie(Movie movie) { var child = new MovieDetailForm(); child.Movie = movie; if (child.ShowDialog(this) != DialogResult.OK) { return; } //Save Movie try { _database.Update(child.Movie); } catch (Exception ex) { DisplayError(ex, "Update failed"); }; UpdateList(); }
private void OnMoviesAdd(object sender, EventArgs e) { var child = new MovieDetailForm(); if (child.ShowDialog(this) != DialogResult.OK) { return; } try { _database.Add(child.Movie); } catch (ValidationException ex) { DisplayError(ex, "Validation Failed"); } catch (Exception ex) { DisplayError(ex, "Add Failed"); }; UpdateList(); }