예제 #1
0
        public static bool InputHonorsDiplomaStatus()
        {
            Console.WriteLine("Do you have honors diploma? (y/n)");
            var resp = UserHelper.GetString("Input can not be empty");

            return(resp[0] == 'y');
        }
예제 #2
0
        public static string InputLink()
        {
            Console.WriteLine("Link: ");
            while (true)
            {
                var link = UserHelper.GetString("Link can not be empty");

                if (ExceptionHandle.Handle(UserHelper.ValidateLink, link))
                {
                    return(link);
                }
            }
        }
예제 #3
0
        public static DateTime InputDateTime(string message)
        {
            Console.WriteLine(message);

            while (true)
            {
                var str = UserHelper.GetString("Datetime can not be empty!");

                var result = DateTime.TryParse(str, out DateTime dateTime);

                if (result)
                {
                    return(dateTime);
                }

                LoggerPublisher.OnLogError("Invalid date time format!");
            }
        }
예제 #4
0
        public static string InputData(string dataName)
        {
            Console.WriteLine($"{dataName}: ");

            return(UserHelper.GetString($"{dataName}: can not be empty"));
        }