Пример #1
0
        /// <summary>
        /// Validate the VIN.
        /// </summary>
        private bool IsLegal()
        {
            bool isLegal = true;

            if (this.vinBox.Text.Length == 17)
            {
                this.prompt.Text = "The VIN is 17 characters long. Good!";
            }
            else
            {
                this.prompt.Text = $"The VIN must be 17 characters long. This is {this.vinBox.Text.Length}.";
                isLegal          = false;
            }

            if (VinForm.IsAlphaNumeric(this.vinBox.Text))
            {
                this.prompt2.Text = "The VIN contains only letters and numbers. Good!";
            }
            else
            {
                this.prompt2.Text = "The VIN must contain only letters and numbers.";
                isLegal           = false;
            }

            return(isLegal);
        }