Beispiel #1
0
        public Form6(MovieClass movie,bool Edit)
        {
            InitializeComponent();

            Movie = movie;
            ReviewTextBox.Text = Movie.Get_Review().Replace(@"\n",Environment.NewLine);

            if (!Edit)
            {
                menuStrip1.Visible = false;
                ReviewTextBox.BackColor = Color.White;
                ReviewTextBox.ReadOnly = true;
                contextMenuStrip1.Items[0].Enabled = contextMenuStrip1.Items[1].Enabled =
                    contextMenuStrip1.Items[2].Enabled = contextMenuStrip1.Items[3].Enabled = contextMenuStrip1.Items[5].Enabled = false;
            }
        }
Beispiel #2
0
        private void Update_Movie_Details(MovieClass Movie)
        {
            try
            {
                Size tempSize = new Size(252, 20);

                Update_Stars_Movie_Details();

                MoviePoster.ImageLocation = "images\\" + Movie.Index.ToString() + ".jpg";
                MovieName.Text = Movie.Movie_Name;

                try
                {
                    tempSize.Width = (int)(252 * float.Parse(Movie.Get_Mark()) / 10);
                    TopPicture.Size = tempSize;
                    TopPicture.Visible = true;
                    pictureBox2.Visible = true;
                }
                catch
                {
                    TopPicture.Visible = false;
                    pictureBox2.Visible = false;
                }

                try
                {
                    tempSize.Width = (int)(252 * float.Parse(Movie.Get_IMDB_Mark()) / 10);
                    TopPictureMark.Size = tempSize;
                    TopPictureMark.Visible = true;
                    pictureBox1.Visible = true;
                }
                catch
                {
                    TopPictureMark.Visible = false;
                    pictureBox1.Visible = false;
                }

                MarkName.Text = Movie.Get_Mark();
                if (Movie.Get_IMDB_Name() != null)
                    IMDBName.Text = "( " + Movie.Get_IMDB_Name() + " )";
                else
                    IMDBName.Text = "( " + Movie.Movie_Name + " ) - no Update";
                MovieNam.Text = Movie.Movie_Name;
                if (Movie.Get_IMDB_Mark() == null)
                    IMDBMarkDate.Text = "Unknown";
                else
                    IMDBMarkDate.Text = Movie.Get_IMDB_Mark();
                if ((Movie.Get_Date_Day() != 0 || Movie.Get_Date_Month() != 0 || Movie.Get_Date_Year() != 0) && Movie.Get_Date_Year() != -1)
                    DateDate.Text = Movie.Get_Date_Month().ToString() + "/" + Movie.Get_Date_Day().ToString() + "/" + Movie.Get_Date_Year().ToString();
                else if (Movie.Get_Date_Year() == -1)
                    DateDate.Text = "Not viewed yet";
                else
                    DateDate.Text = "Unknown";
                ReviewRichTextBox.Text = Movie.Get_Review().Replace(@"\n", Environment.NewLine);
                DirectorDate.Text = Movie.Director;
                DescriptionTextBox.Text = Movie.Storyline;

                try
                {
                    tempSize = new Size(61, 20);
                    YearDate.Size = tempSize;
                    YearDate.Text = int.Parse(Movie.Get_Year()).ToString();
                }
                catch
                {
                    tempSize = new Size(100, 20);
                    YearDate.Size = tempSize;
                    YearDate.Text = Movie.Get_Year();
                }

                List<string> Aux = new List<string>();

                ComboGenreDate.Items.Clear();
                ComboGenreDate.Text = Movie.Get_Genre(0);
                Aux = Movie.Get_Genre();
                foreach(string genre in Aux)
                    ComboGenreDate.Items.Add(genre);

                RuntimeDate.Text = Movie.Runtime;
                MPAAtext.Text = Movie.MPAA_Rating;

                CountryDate.Items.Clear();
                CountryDate.Text = Movie.Get_Country(0);
                Aux = Movie.Get_Country();
                foreach(string country in Aux)
                    CountryDate.Items.Add(country);

                LanguageDate.Items.Clear();
                LanguageDate.Text = Movie.Get_Language(0);
                Aux = Movie.Get_Language();
                foreach(string language in Aux)
                    LanguageDate.Items.Add(language);

                toolTip1.SetToolTip(DirectorWebLink, "Visit " + Movie.Director + "'s page");

                Tags.Items.Clear();
                if (Movie.Get_Tags().Count > 0)
                {
                    Tags.Text = Movie.Get_Tag(0);
                    foreach (string tag in Movie.Get_Tags())
                        Tags.Items.Add(tag);
                }
                else
                    Tags.Text = "Unknown";

                PrizesBox.Text = Movie.Prize;
                toolTip2.SetToolTip(OscarButton, "Visit " + Movie.Movie_Name + "'s Gallery of Trophies");
            }
            catch
            {
            }
        }
Beispiel #3
0
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            try
            {
                Form6 form = new Form6(Movie, true);
                form.Text = Movie.Movie_Name + "'s review edit";

                form.ShowDialog();
                Movie = new MovieClass(Movie.Movie_Name);

                ReviewRichTextBox.Text = Movie.Get_Review().Replace(@"\n", Environment.NewLine).Replace(@"\r", Environment.NewLine);
            }
            catch
            {
                Error_Message();
            }
        }
Beispiel #4
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();
            }
        }
        public static void UpdateMovie(MovieClass Movie,int LastIndex)
        {
            try
            {
                if (DBCon.ConnectionString == "")
                {
                    DBCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Directory.GetCurrentDirectory() + "\\Movies.mdb;User Id=Admin;Password=;";
                    DBCon.Open();
                }

                string command = "UPDATE Movies SET ";
                command += "Name = '" + WorkerClass.StringWithoutApostrophe(Movie.Movie_Name) + "',";
                command += "[Year] = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_Year()) + "',";
                command += "[Mark] = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_Mark()) + "',";
                command += " IMDb_Adress = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_IMDB_Adress()) + "',";
                command += " [Date] = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Month().ToString()) + "/" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Day().ToString()) + "/" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Year().ToString()) + "',";
                command += " [Review] = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_Review()) + "',";
                command += " RunTime = '" + Movie.Runtime + "',";
                command += " IMDb_Name = '" + WorkerClass.StringWithoutApostrophe(Movie.Get_IMDB_Name()) + "',";
                command += " IMDb_Mark = '" + Movie.Get_IMDB_Mark() + "',";
                command += " DirectorName = '" + WorkerClass.StringWithoutApostrophe(Movie.Director) + "',";
                command += " DirectorWebLink = '" + Movie.DirectorLink + "',";
                command += " [Country] = '" + WorkerClass.StringWithApostrophe(WorkerClass.ListToString(Movie.Get_Country())) + "',";
                command += " Stars = '" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Stars())) + "',";
                command += " StarsLink = '" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_StarsLink())) + "',";
                command += " Genres = '" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Genre())) + "',";
                command += " [Language] = '" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Language())) + "',";
                command += " Tags = '" + WorkerClass.StringWithApostrophe(WorkerClass.ListToString(Movie.Get_Tags())) + "',";
                command += " StoryLine = '" + WorkerClass.StringWithoutApostrophe(Movie.Storyline) + "',";
                command += " TrailerMovie = '" + WorkerClass.StringWithoutApostrophe(Movie.MovieTrailer) + "',";
                command += " DefaultMovie = " + (Movie.Default ? 1 : 0).ToString() + ",";
                command += " MPAA = '" + WorkerClass.StringWithoutApostrophe(Movie.MPAA_Rating) + "',";
                command += " Prizes = '" + WorkerClass.StringWithoutApostrophe(Movie.Prize) + "'";
                command += " WHERE Index = " + LastIndex;

                OleDbCommand DBCom = new OleDbCommand(command, DBCon);
                DBCom.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }