/// <summary> /// Delete a movie from a member's record. /// </summary> /// <param name="username"></param> /// <param name="title"></param> /// <param name="storage"></param> public void Return(string username, string title, MovieCollection storage) { foreach (Member member in collection) { if (member.username == username && storage.Find(title) != null) { member.DeleteRecord(storage.Find(title)); } } }
/// <summary> /// Get required information from staff's input to add a new movie to the Movie Collection or add a number of copies to an existing movie. /// </summary> /// <param name="collection"></param> static void AddMovie(MovieCollection collection) { string title = GetTitle(); if (collection.Find(title) == null) { Console.Write("Enter the starring actor(s): "); string starring_input = Console.ReadLine(); string[] starring = starring_input.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); Console.Write("Enter the director(s): "); string director_input = Console.ReadLine(); string[] director = director_input.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); Movie.Genre genre = getGenre(); Movie.Classification classification = getClassification(); Console.Write("Enter the duration (minutes): "); int duration = GetValue(); Console.Write("Enter the release year (year): "); int release_date = GetValue(); Console.Write("Enter the number of copies available: "); int copies = GetValue(); collection.Insert(new Movie(title, starring, director, duration, genre, classification, release_date, copies, 0)); } else { Console.Write("Enter the number of copies you would like to add: "); int value = GetValue(); collection.Add_copies(value, title); } }