Esempio n. 1
0
        internal void PrintCheckedOutElectronics()
        {
            Console.Clear();
            System.Console.WriteLine(@"Please choose from the following options
      ");
            System.Console.WriteLine(@"Checked out Electronics: 
      ");

            for (int i = 0; i < CheckedOutElectronics.Count; i++)
            {
                Electronic currentElectronic = CheckedOutElectronics[i];
                Console.WriteLine($"{i + 1}) {CheckedOutElectronics[i].DeviceName}");
            }
            System.Console.WriteLine(@"
Select an electronic number to return, view available (E)lectronics, view (A)vailable books, or (Q)uit");
        }
Esempio n. 2
0
        internal void CheckoutElectronics(string input)
        {
            Electronic selectedElectronic = ValidateElectronic(input, AvailableElectronics);

            if (selectedElectronic == null)
            {
                Console.Clear();
                System.Console.WriteLine("Invalid Selection... Press enter to continue");
                Console.ReadLine();
                return;
            }
            //set available to false, add book to checked out and remove from available array
            selectedElectronic.Available = false;
            CheckedOutElectronics.Add(selectedElectronic);
            AvailableElectronics.Remove(selectedElectronic);
            Console.Clear();
            System.Console.WriteLine($"Enjoy the {selectedElectronic.DeviceName}");
        }