Пример #1
0
 private void textEdit1_EditValueChanged(object sender, EventArgs e)
 {
     try
     {
         VINDecoder decoder = new VINDecoder();
         VINCarInfo carinfo = decoder.DecodeVINNumber(textEdit1.Text);
         lblCarModel.Text   = carinfo.CarModel.ToString();
         lblEngineType.Text = carinfo.EngineType.ToString();
         lblMakeyear.Text   = carinfo.Makeyear.ToString();
         lblPlant.Text      = carinfo.PlantInfo;
         lblSeries.Text     = carinfo.Series;
         lblTurbo.Text      = carinfo.TurboModel.ToString();
         lblExtraInfo.Text  = carinfo.ExtraInfo;
     }
     catch (Exception E)
     {
         Console.WriteLine("Failed to convert VIN number partially: " + E.Message);
     }
 }
Пример #2
0
        private void DecodeVIN()
        {
            lblCarModel.Text   = "---";
            lblEngineType.Text = "---";
            lblMakeyear.Text   = "---";
            lblPlant.Text      = "---";
            lblSeries.Text     = "---";
            lblTurbo.Text      = "---";
            lblExtraInfo.Text  = "---";
            VINDecoder decoder = new VINDecoder();
            VINCarInfo carinfo = decoder.DecodeVINNumber(textEdit1.Text);

            lblCarModel.Text   = carinfo.CarModel.ToString();
            lblEngineType.Text = carinfo.EngineType.ToString();
            lblMakeyear.Text   = carinfo.Makeyear.ToString();
            lblPlant.Text      = carinfo.PlantInfo;
            lblSeries.Text     = carinfo.Series;
            lblTurbo.Text      = carinfo.TurboModel.ToString();
            lblExtraInfo.Text  = carinfo.ExtraInfo;
        }
Пример #3
0
        public VINCarInfo DecodeVINNumber(string VINNumber)
        {
            VINCarInfo _carInfo = new VINCarInfo();

            if (VINNumber.StartsWith("YV") || VINNumber.StartsWith("4V"))
            {
                _carInfo.Makeyear  = DecodeMakeyear(VINNumber);
                _carInfo.CarModel  = DecodeCarModel(VINNumber, _carInfo.Makeyear);
                _carInfo.ExtraInfo = string.Empty;
                string addInfo = string.Empty;
                _carInfo.EngineType = DecodeEngineType(VINNumber, _carInfo.Makeyear, out addInfo);
                _carInfo.ExtraInfo  = addInfo;
                _carInfo.PlantInfo  = DecodePlantInfo(VINNumber, _carInfo.Makeyear);
                _carInfo.Series     = DecodeSeries(VINNumber, _carInfo.Makeyear);
                _carInfo.TurboModel = DecodeTurboModel(_carInfo.EngineType, _carInfo.CarModel, _carInfo.Makeyear);
                _carInfo.Valid      = true;
            }

            return(_carInfo);
        }
Пример #4
0
        public VINCarInfo DecodeVINNumber(string VINNumber)
        {
            VINCarInfo _carInfo = new VINCarInfo();
            if (VINNumber.StartsWith("YV") || VINNumber.StartsWith("4V"))
            {
                _carInfo.Makeyear = DecodeMakeyear(VINNumber);
                _carInfo.CarModel = DecodeCarModel(VINNumber, _carInfo.Makeyear);
                _carInfo.ExtraInfo = string.Empty;
                string addInfo = string.Empty;
                _carInfo.EngineType = DecodeEngineType(VINNumber, _carInfo.Makeyear, out addInfo);
                _carInfo.ExtraInfo = addInfo;
                _carInfo.PlantInfo = DecodePlantInfo(VINNumber, _carInfo.Makeyear);
                _carInfo.Series = DecodeSeries(VINNumber, _carInfo.Makeyear);
                _carInfo.TurboModel = DecodeTurboModel(_carInfo.EngineType, _carInfo.CarModel, _carInfo.Makeyear);
                _carInfo.Valid = true;
            }

            return _carInfo;
        }