Exemplo n.º 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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 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);
            }
        }