コード例 #1
0
        public bool IsValidInput()
        {
            Regex rgx = new Regex(@"(0[1-9]|[12][0-9]|3[01])[\/\.](0[1-9]|1[012])[\/\.]\d{4}");

            if (rgx.IsMatch(_dateOne) && rgx.IsMatch(_dateTwo))
            {
                return(true);
            }
            FormatView.InvalidInputMsg();
            return(false);
        }
コード例 #2
0
        public void DisplayRangeDates()
        {
            try
            {
                InputValidator userArguments = new InputValidator(_args);

                if (userArguments.IsValidInput())
                {
                    userArguments.ParseToDates();
                    if (userArguments.CheckIfDatesChoronoligic())
                    {
                        userArguments.ViewDates();
                    }
                }
            }
            catch (IndexOutOfRangeException)
            {
                FormatView.InvalidInputMsg();
            }
            FormatView.EndMsg();
        }