Exemple #1
0
        public static void ProcessSortingByDate(ref bool sortOrder)
        {
            string        sortStartMessage = "Would you like the results sorted oldest to latest or latest to oldest?";
            List <string> sortOptions      = new List <string>(2)
            {
                "Oldest to Latest.", "Latest to Oldest."
            };

            UserResponseUtility.DisplayPossibleChoicesToUser(sortStartMessage, sortOptions);
            sortOrder = (UserRequestUtility.ProcessUserInputAgainstPossibleChoices(sortOptions)) switch
            {
                1 => true,
                2 => false,
                _ => throw new NotImplementedException(),
            };
        }
Exemple #2
0
        public static void ProcessSortingByPrice(ref bool sortOrder)
        {
            string        sortStartMessage = "You've chosen to sort orders by subtotal. Sort from lowest to highest subtotal, or highest to lowest subtotal?";
            List <string> sortOptions      = new List <string>(2)
            {
                "Lowest to highest.", "Highest to Lowest."
            };

            UserResponseUtility.DisplayPossibleChoicesToUser(sortStartMessage, sortOptions);
            sortOrder = (UserRequestUtility.ProcessUserInputAgainstPossibleChoices(sortOptions)) switch
            {
                1 => true,
                2 => false,
                _ => throw new NotImplementedException(),
            };
        }
Exemple #3
0
 public void Start()
 {
     Console.WriteLine();
     UserResponseUtility.DisplayPossibleChoicesToUser(StartMessage, PossibleOptions);
 }