public static string GetVehicleModelString( this VehicleCharacteristics chars) { string key = LocalizedCharacteristicsStrings. ResolveVehicleModelKey(chars); /*string groupKey = LocalizedCharacteristicsStrings. * ResolveVehicleModelGroupKey(chars.Language);*/ string groupKey = chars.GeneralVehicleInfo; VehicleCharacteristicsItemsGroup characteristicsGroup = chars. ItemsGroups.FirstOrDefault(g => g.Name.ToUpper().Contains(groupKey.ToUpper())); return(characteristicsGroup.GetValueByKey(key)); }
public static string ResolveVehicleModelKey(VehicleCharacteristics c) { if (c.Language == "en_GB") { return(VehicleModelEn); } else if (c.Language == "ru_RU") { throw new NotSupportedException(); /*return VehicleModelRuCitroen; * return VehicleModelRuPeugeot;*/ } else { throw new NotSupportedException(); } }
public static string GetEngineFamilyString( this VehicleCharacteristics chars) { string generalInformationGroupName = LocalizedCharacteristicsStrings. ResolveGeneralInformationGroupName(chars.Language); VehicleCharacteristicsItemsGroup generalInformationGroup = chars.ItemsGroups.FirstOrDefault( g => g.Name.Contains(generalInformationGroupName)); if (generalInformationGroup == null) { throw new NoInfoForVinException("Insufficient characteristics data"); } string engineFamilyString = generalInformationGroup.GetValueByKey( LocalizedCharacteristicsStrings. ResolveEngineFamilyKey(chars.Language)); return(engineFamilyString); }