//Prompts suer for id and returns movie. Updates inventory and adds return date to transactions
        public static void ReturnMovie()
        {
            Console.Clear();
            Console.WriteLine("\nRETURN MOVIE\n");

            TransactionFile tf = new TransactionFile();

            Transaction[] transList = tf.ReadFile();
            string        email     = ViewRentedMovies();

            int index = -1;
            int id    = -1;

            while (index == -1)
            {
                Console.WriteLine("\nEnter movie ID of movie to return: ");
                string input = Console.ReadLine();

                if (input.All(char.IsNumber))
                {
                    id    = int.Parse(input);
                    index = GetTransactionIndex(transList, id);

                    if (index == -1)
                    {
                        Console.WriteLine("\tError: Movie not found.");
                    }
                }
                else
                {
                    Console.WriteLine("\tError: Enter only numeric values.");
                }
            }
            String[] dateDelin  = DateTime.Now.ToString().Split(' ');
            String   returnDate = dateDelin[0];

            transList[index].SetReturnDate(returnDate);
            tf.WriteFile(transList);

            MovieFile mf = new MovieFile();

            Movie[] inv = mf.ReadFile();
            index = Program.GetMovieIndex(inv, id);
            inv[index].SetStock();
            Console.WriteLine($"\nReturned movie: {inv[index].ReadString()}");
            mf.WriteFile(inv);
        }
        //Prompts user for id and rents movie. Updates inventory and adds to transactions
        public static void RentMovie()
        {
            Console.Clear();
            Console.WriteLine("\nRENT MOVIE\n");

            String          input;
            int             id;
            int             index = -1;
            TransactionFile tf    = new TransactionFile();
            MovieFile       mf    = new MovieFile();

            Movie[] movieInventory = mf.ReadFile();
            ViewAvailableMovies();

            Console.WriteLine("\nEnter email address: ");
            String email = Console.ReadLine();

            while (index == -1)
            {
                Console.WriteLine("\nEnter movie ID to rent:\t(Enter 0 to input movie title instead)");
                input = Console.ReadLine();

                if (input.All(char.IsNumber))
                {
                    id = int.Parse(input);

                    if (id == 0)
                    {
                        Console.WriteLine("\nEnter movie title to rent: ");
                        input = Console.ReadLine();
                        index = Program.GetMovieIndex(movieInventory, input);
                    }
                    else
                    {
                        index = Program.GetMovieIndex(movieInventory, id);
                    }

                    if (index == -1)
                    {
                        Console.WriteLine("\tError: Movie not found.");
                    }
                }
                else
                {
                    Console.WriteLine("\tError: Enter only numeric values.");
                }

                if (index != -1)
                {
                    if (movieInventory[index].GetStock() == false)
                    {
                        Console.WriteLine("\tError: Selected movie is unavailable. Please select a different movie.");
                        index = -1;
                    }
                }
            }
            movieInventory[index].SetStock();
            mf.WriteFile(movieInventory);

            String[] dateDelin = DateTime.Now.ToString().Split(' ');
            String   rentDate  = dateDelin[0];

            Transaction[] transactions = tf.ReadFile();
            tf.IncrementCount();

            Transaction newTransaction = new Transaction(tf.GetID(), email, movieInventory[index].GetMovieID(), rentDate);
            int         count          = tf.GetCount();

            Transaction[] updatedTransactions = new Transaction[count];

            for (int i = 0; i < count - 1; i++)
            {
                updatedTransactions[i] = transactions[i];
            }
            updatedTransactions[updatedTransactions.Length - 1] = newTransaction;

            Console.WriteLine($"\nRented movie: {movieInventory[index].ReadString()}");

            tf.WriteFile(updatedTransactions);
        }