Exemplo n.º 1
0
        public int CompareTo(object obj)
        {
            if (obj == null || !(obj is VideoMovie))
            {
                return(1);
            }

            VideoMovie videoMovie = obj as VideoMovie;

            if (videoMovie != null)
            {
                return(this.MovieName.CompareTo(videoMovie.MovieName));
            }

            return(-1);
        }
Exemplo n.º 2
0
        public static void InventoryMenu()
        {
            Console.Clear();
            Console.WriteLine("inventory\n" +
                              "1. All movies list\n" +
                              "2. Add movie to inventory\n" +
                              "3. Delete movie from inventory\n" +
                              "4. Back to main menu");
            var keyPushed = Console.ReadKey(true).Key;

            switch (keyPushed)
            {
            case ConsoleKey.D1:
                Console.Clear();
                Inventory.ShowAllMoviesRoster();
                Console.ReadKey();
                break;

            case ConsoleKey.D2:
                Console.Clear();
                Console.Write("Movie name: ");
                string     MovieName = Console.ReadLine();
                VideoMovie videoMov  = new VideoMovie(MovieName);
                Inventory.AddMovieToInventory(videoMov);
                break;

            case ConsoleKey.D4:     //4
                Menu.StartMenu();
                break;

            default:
                Console.WriteLine("Something wrong. Back to main menu");
                StartMenu();
                break;
            }
            Menu.StartMenu();
        }
Exemplo n.º 3
0
 static public void AddMovieToInventory(VideoMovie videoMovie)//2
 {
     allMovies.Add(videoMovie);
 }