Пример #1
0
        private void UpdatingForm_Load(object sender, EventArgs e)
        {
            MovieClass Movie = new MovieClass();

            double count = 0;
            int NumberOfUpdates = NumberOfUpdatedItems();

            for (int i = 0; i < MovieList.Items.Count; i++)
            {
                if (MovieList.GetItemChecked(i) == true)
                {
                    Movie = new MovieClass(MovieList.Items[i].ToString());

                    MovieName.Text = "Updating: " + Movie.Movie_Name;

                    count += 100.0 / NumberOfUpdates;
                    progressBar1.Value = (int)(count + .5) <= 100 ? (int)(count + .5) : 100;

                    Thread newThread = new Thread(new ThreadStart(Movie.Update_Movie));

                    try
                    {
                        newThread.Start();
                        newThread.Join();
                    }
                    catch { }
                }
            }

            this.Close();
        }
Пример #2
0
        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
            {
            }
        }
Пример #3
0
        private void Add_MovieToList(string movieName)
        {
            try
            {
                MovieClass movie = new MovieClass(movieName);

                ListViewItem item = new ListViewItem(movie.Movie_Name);
                item.SubItems.Add(movie.Get_Genre(1));
                item.SubItems.Add(movie.Get_Mark());
                item.SubItems.Add(movie.Get_Year());
                item.SubItems.Add(movie.Director);
                if (movie.Runtime != null)
                    item.SubItems.Add(movie.Runtime.Replace(" min", ""));
                else
                    item.SubItems.Add("Unknown");
                if (movie.Get_Date_Year() == -1)
                    item.SubItems.Add("Not viewed yet");
                else if (movie.Get_Date_Year() == 0)
                    item.SubItems.Add("Unknown");
                else
                    item.SubItems.Add(movie.Get_Date_Month().ToString() + "/" + movie.Get_Date_Day().ToString() + "/"
                        + movie.Get_Date_Year().ToString());
                item.SubItems.Add(movie.Get_Country(0));
                item.SubItems.Add(movie.Get_Language(0));
                //item.SubItems.Add(Name);
                MovieList.Items.Add(item);
            }
            catch
            {
                Error_Message();
            }
        }
Пример #4
0
        public TrailerForm(MovieClass movie)
        {
            InitializeComponent();

            Movie = movie;

            this.Text = Movie.Movie_Name + "'s Trailer";
        }
Пример #5
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;
            }
        }
Пример #6
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;
        }
Пример #7
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;
        }
Пример #8
0
        private void SaveInFile(string fileName, List<string> movies)
        {
            StreamWriter f = new StreamWriter(fileName);

            try
            {
                MovieClass[] Movies = new MovieClass[movies.Count];

                int i = 0;

                foreach(string movie in movies)
                    Movies[i++] = new MovieClass(movie);

                Array.Sort(Movies, new DateComparer());

                foreach(MovieClass Movie in Movies)
                {
                    if (NameBox.Checked == true)
                        f.Write(Movie.Movie_Name + " ");
                    if (YearBox.Checked == true)
                        f.Write("(" + Movie.Get_Year() + ") ");
                    if (MarkBox.Checked == true)
                        f.Write("- " + Movie.Get_Mark()+"/10");
                    if (DateBox.Checked == true)
                        f.Write(" (" + Movie.Get_Date_Day() + "/" + Movie.Get_Date_Month() + "/" + Movie.Get_Date_Year() + ")");

                    f.WriteLine();
                    f.WriteLine();
                }
            }
            catch
            {
                f.Close();
            }

            f.Close();
        }
Пример #9
0
        private void SaveInFileXML(string fileName, List<string> movies)
        {
            try
            {
                MovieClass[] Movies = new MovieClass[movies.Count];

                int i = 0;

                foreach(string movie in movies)
                    Movies[i++] = (new MovieClass(movie));

                Array.Sort(Movies,new DateComparer());

                XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.UTF8);

                writer.WriteStartDocument();

                writer.WriteStartElement("movielist");

                foreach(MovieClass Movie in Movies)
                {
                    writer.WriteStartElement("movie");

                    writer.WriteStartElement("name");
                    writer.WriteString(Movie.Movie_Name);
                    writer.WriteEndElement();

                    if (YearBox.Checked == true)
                    {
                        writer.WriteStartElement("year");
                        writer.WriteString(Movie.Get_Year());
                        writer.WriteEndElement();
                    }

                    if (MarkBox.Checked == true)
                    {
                        writer.WriteStartElement("mark");
                        writer.WriteString(Movie.Get_Mark());
                        writer.WriteEndElement();
                    }

                    if (DateBox.Checked == true)
                    {
                        writer.WriteStartElement("date");
                        writer.WriteString(Movie.Get_Date_Day() + "/" + Movie.Get_Date_Month() + "/" + Movie.Get_Date_Year());
                        writer.WriteEndElement();
                    }

                    writer.WriteEndElement(); //movie
                }

                writer.WriteEndElement();

                writer.WriteEndDocument();

                writer.Close();
            }
            catch
            {
            }
        }
Пример #10
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();
            }
        }
Пример #11
0
        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            JumpForm form = new JumpForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                Movie = new MovieClass(form.Result);

                Update_Movie_Details(Movie);
                for (int i = 0; i < MovieList.Items.Count; i++)
                    if (form.Result.ToUpper() == MovieList.Items[i].Text.ToUpper())
                        MovieList.Items[i].Selected = true;
            }
        }
Пример #12
0
        private void MovieList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MovieList.SelectedIndices.Count > 0)
            {
                Movie = new MovieClass(MovieList.SelectedItems[0].Text);

                Update_Movie_Details(Movie);
            }
        }
Пример #13
0
        private void reloadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Movie = new MovieClass(MovieList.SelectedItems[0].Text);

            Update_MovieList(MovieList.SelectedIndices[0]);

            Update_Movie_Details(Movie);
        }
Пример #14
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();
            }
        }
Пример #15
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Are you sure you want to delete \"" + Movie.Movie_Name + "\" movie?", "Delete movie", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    string DeletedMovie = MovieList.SelectedItems[0].Text;
                    MovieClass movie = new MovieClass(DeletedMovie);

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

                    DataBaseManipulation.DeleteMovieFromDB(DeletedMovie);

                    MovieList.SelectedItems[0].Remove();

                    if (MovieList.Items.Count > 0)
                    {
                        if (DataBaseManipulation.DefaultMovie().Movie_Name != null)
                            Update_Movie_Details(DataBaseManipulation.DefaultMovie());
                        else
                            Movie = new MovieClass(MovieList.Items[0].Text);
                    }
                }
            }
            catch
            {
                return;
            }
        }
Пример #16
0
        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);
            }
        }
Пример #17
0
 public Form4(MovieClass MovieCl)
 {
     InitializeComponent();
     Movie = MovieCl;
 }
Пример #18
0
        private void Update_MovieList(int index)
        {
            try
            {
                MovieClass movie = new MovieClass(MovieList.Items[index].Text);

                MovieList.Items[index].Text = movie.Movie_Name;
                MovieList.Items[index].SubItems[1].Text = movie.Get_Genre(0);
                MovieList.Items[index].SubItems[2].Text = movie.Get_Mark();
                MovieList.Items[index].SubItems[3].Text = movie.Get_Year();
                MovieList.Items[index].SubItems[4].Text = movie.Director;
                if (movie.Runtime != null)
                    MovieList.Items[index].SubItems[5].Text = movie.Runtime.Replace(" min", "");
                else
                    MovieList.Items[index].SubItems[5].Text = "Unknown";
                if (movie.Get_Date_Year() == 0)
                    MovieList.Items[index].SubItems[6].Text = "Unknown";
                else
                    MovieList.Items[index].SubItems[6].Text = movie.Get_Date_Month().ToString() + "/" + movie.Get_Date_Day().ToString() + "/"
                        + movie.Get_Date_Year().ToString();
                MovieList.Items[index].SubItems[7].Text = movie.Get_Country(0);
                MovieList.Items[index].SubItems[8].Text = movie.Get_Language(0);
            }
            catch
            {
                return;
            }
        }
Пример #19
0
        private void UpdateList()
        {
            try
            {
                int index = 0;
                string DefaultName = DataBaseManipulation.DefaultMovie().Movie_Name;

                Update_MovieList();

                for (index = 0; index < MovieList.Items.Count && MovieList.Items[index].Text != DefaultName; index++) ;

                if (index >= MovieList.Items.Count)
                {
                    Movie = new MovieClass(MovieList.Items[0].Text);
                    MovieList.Items[0].Selected = true;
                    Update_Movie_Details(Movie);
                }
                else
                {
                    Movie = new MovieClass(DefaultName);
                    MovieList.Items[index].Selected = true;
                    Update_Movie_Details(Movie);
                }
            }
            catch
            { }
        }
Пример #20
0
        private void SetMovieTrailer(MovieClass Movie)
        {
            try
            {
                if (Movie.MovieTrailer == null || Movie.MovieTrailer == "")
                {
                    axShockwaveFlash1.Movie = "http://www.youtube.com/v/" + Movies[0].Key;
                    MovieListTrailers.Items[0].Selected = true;
                }
                else
                {
                    bool Exist = false;

                    axShockwaveFlash1.Movie = "http://www.youtube.com/v/" + Movie.MovieTrailer;

                    for (int i = 0; i < Movies.Count; i++)
                        if (Movies[i].Key == Movie.MovieTrailer)
                        {
                            MovieListTrailers.Items[i].Selected = true;
                            Exist = true;
                        }

                    if (!Exist)
                        AddMovieTrailer(Movie.MovieTrailer);
                }
            }
            catch
            {
                return;
            }
        }
Пример #21
0
        public MovieForm(MovieClass movie)
        {
            InitializeComponent();

            Movie = movie;
        }
Пример #22
0
 private void TakeTrailerMovieList(MovieClass Movie)
 {
     try
     {
         if (Movie.Get_IMDB_Name() != null)
             Movies = WorkerClass.Movie_Trailer_Link(Movie.Get_IMDB_Name());
         else
             Movies = WorkerClass.Movie_Trailer_Link(Movie.Movie_Name);
     }
     catch
     {
         return;
     }
 }
Пример #23
0
        private void Update_MovieList()
        {
            MovieClass movie = new MovieClass();

            for (; MovieList.Items.Count > 0; MovieList.Items[0].Remove()) ;

            List<string> MovieNameList = DataBaseManipulation.MovieDetails("Name");

            foreach(string MovieName in MovieNameList)
            {
                movie = new MovieClass(MovieName);
                if (movie.Movie_Name != null)
                {
                    ListViewItem item = new ListViewItem(movie.Movie_Name);
                    item.SubItems.Add(movie.Get_Genre(0));
                    item.SubItems.Add(movie.Get_Mark());
                    item.SubItems.Add(movie.Get_Year());
                    item.SubItems.Add(movie.Director);
                    if (movie.Runtime != null)
                        item.SubItems.Add(movie.Runtime.Replace(" min", ""));
                    else
                        item.SubItems.Add("Unknown");
                    if (movie.Get_Date_Year() == -1)
                        item.SubItems.Add("Not yet viewed");
                    else if (movie.Get_Date_Year() == 0)
                        item.SubItems.Add("Unknown");
                    else
                        item.SubItems.Add(movie.Get_Date_Month().ToString() + "/" + movie.Get_Date_Day().ToString() + "/"
                            + movie.Get_Date_Year().ToString());
                    item.SubItems.Add(movie.Get_Country(0));
                    item.SubItems.Add(movie.Get_Language(0));
                    //item.SubItems.Add(Name);
                    MovieList.Items.Add(item);
                }
            }
        }
Пример #24
0
        private void propertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                MovieClass Movie = new MovieClass();
                Movie = Movies[ListOfMovies.SelectedIndices[0]];
                Movie.Update_Movie();
                Movie.Movie_Name = Movies[ListOfMovies.SelectedIndices[0]].MovieName;

                Thread.Sleep(1000);

                MovieForm form = new MovieForm(Movie);
                form.ShowDialog();

                form.Dispose();
                WorkerClass.DeleteFolder(Movie.Movie_Name);

            }
            catch
            {

            }
        }
Пример #25
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
            {
            }
        }
Пример #26
0
        public static int InsertMovie(MovieClass Movie)
        {
            try
            {
                if (DBCon.ConnectionString == "")
                {
                    DBCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Directory.GetCurrentDirectory()+"\\Movies.mdb;User Id=Admin;Password=;";
                    DBCon.Open();
                }

                new OleDbCommand("INSERT INTO Movies ([Name]) VALUES('Google.txt')", DBCon).ExecuteNonQuery();

                OleDbDataReader reader = MovieDBReader("Google.txt");

                reader.Read();

                UpdateMovie(Movie, int.Parse(reader["Index"].ToString()));

                /*string command = "INSERT INTO Movies VALUES(";
                command += (int.Parse(reader["Index"].ToString())+1).ToString();
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Movie_Name) + "'";
                command += ",'" + Movie.Get_Year() + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Get_Mark()) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Get_IMDB_Adress()) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Month().ToString()) + "/" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Day().ToString()) + "/" + WorkerClass.StringWithoutApostrophe(Movie.Get_Date_Year().ToString()) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Get_Review()) + "'";
                command += ",'" + Movie.Runtime + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Get_IMDB_Name()) + "'";
                command += ",'" + Movie.Get_IMDB_Mark() + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Director) + "'";
                command += ",'" + Movie.DirectorLink + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Genre())) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Stars())) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_StarsLink())) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Genre())) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(WorkerClass.ListToString(Movie.Get_Tags())) + "'";
                command += ",'" + WorkerClass.ListToString(Movie.Get_Language()) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.Storyline) + "'";
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.MovieTrailer) + "'";
                command += "," + (Movie.Default ? 1 : 0).ToString();
                command += ",'" + WorkerClass.StringWithoutApostrophe(Movie.MPAA_Rating) + "')";
                OleDbCommand DBCom = new OleDbCommand(command, DBCon);
                //OleDbDataReader reader =  DBCom.ExecuteReader();

                DBCom.ExecuteNonQuery();

                //MessageBox.Show(Movie.Movie_Name + " Successfully Updated!", "Updated");

                //for (; reader.Read(); )
                //MessageBox.Show("Command : " + reader["Name"].ToString() + " was executed !!!", "Executed");
                return 1;*/

                return 1;
            }
            catch
            {
                return 0;
            }
        }