/// <span class="code-SummaryComment"><summary></span> /// Adds one movie to the movie list file /// <span class="code-SummaryComment"></summary></span> /// <span class="code-SummaryComment"><param name="sender"></param></span> /// <span class="code-SummaryComment"><param name="e"></param></span> /// private void tsbAdd_Click(object sender, EventArgs e) { currentMovie = new MovieData(); PopulateData pd = new PopulateData(); pd.populate(textBox1, textBox2, dateTimePicker1, currentMovie); ClearData cd = new ClearData(); cd.clear(textBox1, textBox2, dateTimePicker1, dirtyForm); DuplicateData dd = new DuplicateData(); if (!dd.Check(movies , currentMovie)) { movies.Add(currentMovie);//Add current movie to the List object } dirtyForm = true; }
/// <span class="code-SummaryComment"><summary></span> /// Create a new movie data file, .movie, that stores movie entries /// which will be keyed in by user one by one /// <span class="code-SummaryComment"></summary></span> /// <span class="code-SummaryComment"><param name="sender"></param></span> /// <span class="code-SummaryComment"><param name="e"></param></span> private void newToolStripMenuItem_Click(object sender, EventArgs e) { if (dirtyForm == true) { if (MessageBox.Show(this, "You have not saved the current movie data; would you like to save before starting a new " + "movie database?", "Save Current Data", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { saveAsToolStripMenuItem_Click(this, new EventArgs()); } else { // discard and start new document movies = new List<MovieData>(); ClearData cd = new ClearData(); cd.clear(textBox1, textBox2, dateTimePicker1, dirtyForm); } } else { // start new document movies = new List<MovieData>(); ClearData cd = new ClearData(); cd.clear(textBox1, textBox2, dateTimePicker1, dirtyForm); } }