Esempio n. 1
0
        private void clearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string ClearingMovie = MovieList.SelectedItems[0].Text.ToString();
                MovieClass movie = new MovieClass(ClearingMovie);

                if (Directory.Exists("images\\" + movie.Index.ToString() + " Stars") == true)
                    Directory.Delete("images\\" + movie.Index.ToString() + " Stars", true);
                if (File.Exists("images\\" + movie.Index.ToString() + ".jpg") == true)
                    File.Delete("images\\" + movie.Index.ToString() + ".jpg");

                Movie = new MovieClass(ClearingMovie);
                MovieClass MovieAux = new MovieClass();
                MovieAux.Movie_Name = Movie.Movie_Name;
                MovieAux.Set_Date(Movie.Get_Date_Day().ToString(), Movie.Get_Date_Month().ToString(), Movie.Get_Date_Year().ToString());
                MovieAux.Set_IMDB_Adress(Movie.Get_IMDB_Adress());
                MovieAux.Set_Mark(Movie.Get_Mark());
                MovieAux.Set_Review(Movie.Get_Review());
                if (DataBaseManipulation.DefaultMovie().Movie_Name == MovieAux.Movie_Name)
                    MovieAux.Default = true;
                DataBaseManipulation.UpdateMovie(MovieAux);

                Update_Movie_Details(MovieAux);

                reloadToolStripMenuItem_Click(sender, e);

                MessageBox.Show("\"" + ClearingMovie + "\" was successfully cleaned!", "Successfully cleaned", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch
            {
                Error_Message();
            }
        }