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; }
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(); } }
private void Create_Movie_File() { try { MovieClass Movie = new MovieClass(); Movie.Movie_Name = AddBox.Text; Movie.Set_Year(YearBox.Text); Movie.Set_Mark(MarkBox.Text); if (IMDBBox.Text.IndexOf("http") == -1) IMDBBox.Text = "http://" + IMDBBox.Text; Movie.Set_IMDB_Adress(IMDBBox.Text); if (TBDBox.Checked == true) Movie.Set_Date("-1", "-1", "-1"); else if ((NoDBox.Checked == true || DateMonth.Text == "Month" || DateDay.Text == "Day" || DateYear.Text == "Year") && TodayButton.Checked == false) Movie.Set_Date("0", "0", "0"); else if (TodayButton.Checked == true) Movie.Set_Date(DateTime.Now.Day.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Year.ToString()); else Movie.Set_Date(DateDay.Text, DateMonth.Text, DateYear.Text); Movie.Update_Informations(); } catch { } }