Example #1
0
        internal static string AskConfirmation(string msg = "")
        {
            if (msg != "")
            {
                CommonIO.MessageToUserInBlue(msg);
            }
            string usrResponse = Console.ReadLine();

            return(usrResponse.ToUpper());
        }
Example #2
0
        public static decimal AskForArea()
        {
            Console.WriteLine("What is area in square feet (min=100)?");
            decimal area = 0;
            int     min = 100, max = 100000;

            do
            {
                area = CommonIO.GetIntFromUser(min, max);
                if (area < 100)
                {
                    CommonIO.MessageToUserInBlue("Please enter a number between 100 and 100000");
                }
            } while (area < min && area > max);
            return(area);
        }
Example #3
0
        internal static string RequireYorN(string msg = "")
        {
            if (msg != "")
            {
                CommonIO.MessageToUserInBlue(msg);
            }
            string usrResponse = "";

            do
            {
                usrResponse = Console.ReadLine().ToUpper();
                if ((usrResponse != "Y") && (usrResponse != "N"))
                {
                    Console.WriteLine("You must enter y or n.");
                }
            } while (usrResponse != "Y" && usrResponse != "N");

            return(usrResponse.ToUpper());
        }
Example #4
0
        public static OrderLookupResponse AskForExistingOrder()
        {
            OrderManager manager = OrderManagerFactory.Create();

            DateTime fileDateTime = ConsoleIO.AskForOrderDate();

            //Ask the user to select a date by the number listed.
            int userNumChoice = CommonIO.GetIntFromUser(1, 999, 0, "What order number would you like to view?");

            OrderLookupResponse response = manager.LookupOrder(fileDateTime, userNumChoice);

            if (!response.Success)
            {
                response.Message = "Order not found";

                CommonIO.MessageToUserInBlue(response.Message);
                CommonIO.Continue();
            }
            return(response);
        }