//Edits an existing movie and its data public bool editMovie(string title, genreEnum genre, ratingEnum rating, string file, int year, string image, string description, List <string> actors, int index, out string result) { if (title.Trim() != "") { if (file.Trim() != "") {//Genre and Rating can never be null movieList[index].setTitle(title); movieList[index].Genre = genre; movieList[index].Rating = rating; movieData[movieList[index].File].Year = year; movieData[movieList[index].File].Image = image; movieData[movieList[index].File].Description = description; movieData[movieList[index].File].addActors(actors); result = "File Edited"; writeList(); Console.WriteLine(movieList[index]); return(true); } else { result = "File field invalid"; return(false); } } else { result = "Title field invalid"; return(false); } }
public simpleMovie(string title, string file, ratingEnum rating, genreEnum genre) { this.title = title; this.file = file; this.rating = rating; this.genre = genre; hasThe = theSubstringCheck(); }
//Image, Year, Description and Actors will be in a seperate data structure public simpleMovie(string title, string file) { this.title = title; this.file = file; genre = genreEnum.Unknown; rating = ratingEnum.Unknown; hasThe = theSubstringCheck(); }
public info(string title, string file, ratingEnum rating, genreEnum genre) { this.title = title; this.file = file; this.rating = rating; this.genre = genre; hasThe = theSubstringCheck(); setThisID(); }
//Image, Year, Description and Actors will be in a seperate data structure //To be added, a MovieSet class, which contains a set of info class for movies of the same set (The Matrix, The Matrix 2..., The Matrix 3...) public info(string title, string file) { this.title = title; this.file = file; genre = genreEnum.Unknown; rating = ratingEnum.Unknown; hasThe = theSubstringCheck(); setThisID(); }
public Book(string title, string author, genreEnum genre, int pub_year, string Edition_Lang, int ID_No) { this.Title = title; this.Author = author; this.Genre = genre; this.Pub_Year = pub_year; this.Edition_Lang = Edition_Lang; this.ID_No = ID_No; }
//Adds a new movie and its data public bool addMovie(string title, genreEnum genre, ratingEnum rating, string file, int year, string image, string description, List <string> actors, out string result) { if (title.Trim() != "") { if (file.Trim() != "") {//Genre and Rating can never be null if (!movieData.ContainsKey(file)) { movieList.Add(new info(title, file, rating, genre)); movieData.Add(file, new data(year, image, description, 0)); if (actors.Count != 0) { movieData[file].addActors(actors); } result = "Movie added"; sorted = false; writeList(); Console.WriteLine(movieList.Last()); return(true); } else { result = "File already exists"; return(false); } } else { result = "File field invalid"; return(false); } } else { result = "Title field invalid"; return(false); } }
public episode(string title, string file, ratingEnum rating, genreEnum genre, string seasonTitle, int epNumber) : base(title, file, rating, genre) { }
public void readAll(ref List <info> readList) { string title = String.Empty; string file = String.Empty; genreEnum genre = genreEnum.Unknown; ratingEnum rating = ratingEnum.Unknown; using (XmlReader reader = XmlReader.Create(this.file)) { while (reader.Read()) { if (reader.IsStartElement()) { if (reader.Name == "Title") { title = reader.ReadElementContentAsString(); reader.MoveToNextAttribute(); if (reader.Name == "File") //These checks prevent the wrong field being read to the wrong variable { file = reader.ReadElementContentAsString(); } reader.MoveToNextAttribute(); try { if (reader.Name == "Genre") //These checks prevent the wrong field being read to the wrong variable { genre = (genreEnum)(Int32.Parse(reader.ReadElementContentAsString())); } } catch (Exception e) { this.ge.GlobalTryCatch(e, "Genre Read In Error"); genre = genreEnum.Unknown; } reader.MoveToNextAttribute(); try { if (reader.Name == "Rating") //These checks prevent the wrong field being read to the wrong variable { rating = (ratingEnum)(Int32.Parse(reader.ReadElementContentAsString())); } } catch (Exception e) { this.ge.GlobalTryCatch(e, "Rating Read In Error"); rating = ratingEnum.Unknown; } reader.MoveToNextAttribute(); readList.Add(new info(title, file, rating, genre)); title = ""; file = ""; genre = genreEnum.Unknown; rating = ratingEnum.Unknown; } } } } }