示例#1
0
        private void Addbutton_Click(object sender, EventArgs e)
        {
            MovieClass Movie = new MovieClass();
            Movie = Movies[ListOfMovies.SelectedIndices[0]];
            Movie.Movie_Name = WorkerClass.AvailableFolderName(Movies[ListOfMovies.SelectedIndices[0]].MovieName);

            Movie.Update_Movie();

            WorkerClass.WriteFile("Movies.txt", Movie.Movie_Name, true);

            Form4 form = new Form4(Movie);

            if (form.ShowDialog() == DialogResult.Cancel)
                WorkerClass.DeleteFolder(Movie.Movie_Name);
            else
                added = true;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            MovieClass movie = new MovieClass();
            movie.Movie_Name = Title.Text;
            movie.Set_IMDB_Adress(link);

            Form4 form = new Form4(movie);
            form.ShowDialog();

            if (form.DialogResult == DialogResult.Cancel)
                return;

            DataBaseManipulation.InsertMovie(movie);
            movie.Update_Movie();

            updated = true;
        }
示例#3
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                Form4 form = new Form4(Movie);
                form.Text = "Edit " + Movie.Movie_Name;

                if (form.ShowDialog() != DialogResult.Cancel)
                {
                    MovieList.SelectedItems[0].Text = form.AddBox.Text;
                    reloadToolStripMenuItem_Click(sender, e);
                }
            }
            catch
            {
                MessageBox.Show("Please select a movie to be edited!", "Select a movie", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#4
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            Form4 form = new Form4(Movie);
            form.Text = "Edit " + Movie.Movie_Name;

            form.Show();

            form.FormClosed += new FormClosedEventHandler(form_FormClosed);
        }