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); } }
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; }
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); }
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; }