Exemple #1
0
        /// <summary>
        /// Open the movie editor
        /// </summary>
        /// <param name="id"></param>
        private void _OpenMovieEditor(string id)
        {
            MovieForm mf;

            if(id != null
            && id.Trim() != "") {
                mf = new MovieForm(id);
            }
            else {
                mf = new MovieForm();
            }

            if(mf.ShowDialog(this) == DialogResult.OK) {
                this._InitControls(false);
                this._StartSearch();
            }
        }
        /// <summary>
        /// Handles the Click event of the btnOpenEditor control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnOpenEditor_Click(object sender, EventArgs e)
        {
            if(this.txtResponse.Text.Length > 0) {
                WikipediaParser parser = new WikipediaParser(
                    Configuration.ConnectionString
                );

                Movie mov = parser.Parse(this.txtResponse.Text);

                // search for movie with title like mov.Title

                if(mov != null) {
                    MovieForm form = new MovieForm(mov);

                    if(form.ShowDialog(this) == DialogResult.OK) {
                        // alles schliessen
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                        this.DialogResult = DialogResult.OK;
                    }
                }
                else {
                    StaticWindows.ErrorBox("Fehler: Es konnte kein Film geparst werden!");
                }
            }
            else {
                StaticWindows.ErrorBox("Fehler: Es ist kein Wikipedia Artikel ausgewählt!");
            }
        }