Esempio n. 1
0
        private void CheckClicked(object sender, RoutedEventArgs e)
        {
            Disable();
            vinOnCheck = textBoxVin.Text;
            if (!VinValidator.Validate(vinOnCheck))
            {
                textBlockCheckResult.Foreground =
                    new SolidColorBrush(Colors.Red);
                textBlockCheckResult.Text = CodeBehindStringResolver.Resolve(
                    "IncorrectVinErrorText");
                Enable();
                return;
            }
            Manufacturer?manuf = VinValidator.GetManufacturer(vinOnCheck);

            if (manuf == null)
            {
                textBlockCheckResult.Foreground =
                    new SolidColorBrush(Colors.Red);
                textBlockCheckResult.Text = CodeBehindStringResolver.Resolve(
                    "UnsupportedManufacturerErrorText");
                Enable();
            }
            VtsWebServiceClient service = new VtsWebServiceClient();

            service.GetVehicleInformationByVinCompleted +=
                ServiceOnGetVehicleInformationByVinCompleted;
            service.GetVehicleInformationByVinAsync(vinOnCheck);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //string vin = "1VWBP7A37DC046870";
            //string vin = "12345678901234567";

            string vin = args.Length > 0 ? args[0] : string.Empty;

            if (string.IsNullOrWhiteSpace(vin))
            {
                Console.WriteLine("VIN not provided");
                return;
            }

            var validationResult = VinValidator.Validate(vin);

            Console.WriteLine($"VIN Provided:     {vin}");
            Console.WriteLine($"Is Valid:         {validationResult.IsValid}");
            Console.WriteLine($"Validation Error: {validationResult.Error}");
        }