Ejemplo n.º 1
0
 void _storage_LoadEngineTypesComplete(object sender, EventArgs e)
 {
     if (_carDetail == null)
     {
         return;
     }
     EngineType = EngineTypes.FirstOrDefault(o => o.Name.Equals(_carDetail.EngineType));
 }
Ejemplo n.º 2
0
        //派生和车型的对应关系?
        //public List<LEngineTypeModel> LEngineTypes { get; set; }

        /// <summary>
        /// 获取发动机机型
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public EngineTypeModel GetEngineType(string code)
        {
            return(EngineTypes?.FirstOrDefault(x =>
                                               code.GetString(x.FeatureIndex.Split(',').Select(xx => int.Parse(xx) - 1).ToArray())
                                               .Equals(x.FeatureCode, StringComparison.CurrentCultureIgnoreCase)));
        }