Example #1
0
        private bool IsLegalHoursTenths()
        {
            if (this.hourstenthsBox.Text.Length >= 2)
            {
                this.prompt.Text = $"Hours tenths should be no more than 1. {this.hourstenthsBox.Text.Length}.";
                return(false);
            }

            if (!MileageForm.IsNumeric(this.hourstenthsBox.Text))
            {
                this.prompt.Text = "The hours tenths must contain only numbers.";
                return(false);
            }

            return(true);
        }
Example #2
0
        /// <summary>
        /// Validate the VIN.
        /// </summary>
        private bool IsLegalMiles()
        {
            if (this.mileageBox.Text.Length >= 7)
            {
                this.prompt.Text = $"Mileage should be no more than 6. {this.mileageBox.Text.Length}.";
                return(false);
            }

            if (!MileageForm.IsNumeric(this.mileageBox.Text))
            {
                this.prompt.Text = "The mileage must contain only numbers.";
                return(false);
            }

            return(true);
        }